From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from carson.u.washington.edu ([140.142.52.11]) by hawkwind.utcs.toronto.edu with SMTP id <2750>; Thu, 8 Oct 1992 16:58:57 -0400 Received: by carson.u.washington.edu (5.65/UW-NDC Revision: 2.22 ) id AA03054; Thu, 8 Oct 92 13:58:33 -0700 Date: Thu, 8 Oct 1992 16:58:33 -0400 From: Donn Cave Message-Id: <9210082058.AA03054@carson.u.washington.edu> Sender: donn@carson.u.washington.edu To: rc@hawkwind.utcs.toronto.edu Subject: rc and null environ strings Am having this problem with rc version 1.4: ; A = '' ./rc ; whatis A A='' ; A = ralph segmentation violation--core dumped ; In other words, assigning to a zero-length variable is fatal. However, this happens only after reading that (zero-length) value (hence the "whatis" in the example). Trace back looks like this: (gdb) where #0 0xbc2e in free () #1 0x68bc in efree (p=(int *) 0x212d) (nalloc.c line 135) #2 0x5eba in listfree (p=(struct List *) 0x177d8) (list.c line 17) #3 0x3d31 in get_var_place (s=(char *) 0x167d4 , stack=FALSE) (hash.c line 157)#4 0x8485 in varassign (name=(char *) 0x167d4 , def=(struct List *) 0x16804, stack=FALSE) (var.c line 18) #5 0x3156 in assign (s1=(struct List *) 0x16810, s2=(struct List *) 0x16804, stack=FALSE) (glom.c line 163) #6 0x9264 in walk (n=(struct Node *) 0x167f8, parent=TRUE) (walk.c line 160) #7 0x4cb6 in doit (execit=TRUE) (input.c line 332) #8 0x63f3 in main (argc=1, argv=(char **) 0x3fffdccc, envp=(char **) 0x3fffdcd4 Platform is DYNIX/ptx on a Sequent 2000/750. The value of p->w, passed to efree() at list.c line 17, looks uninitialized to me, but that's as far as I have taken it. rc 1.2 doesn't have this problem, although it oddly can't find zero-length variables passed in in the environment. "es" works fine. Donn Cave, University Computing Services, University of Washington donn@cac.washington.edu