rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Donn Cave <donn@u.washington.edu>
To: rc@hawkwind.utcs.toronto.edu
Subject: rc and null environ strings
Date: Thu, 8 Oct 1992 16:58:33 -0400	[thread overview]
Message-ID: <9210082058.AA03054@carson.u.washington.edu> (raw)

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


                 reply	other threads:[~1992-10-08 20:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9210082058.AA03054@carson.u.washington.edu \
    --to=donn@u.washington.edu \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).