Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!cmcl2!husc6!rutgers!clyde!cuae2!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: The mysterious error message Message-ID: <1356@ttrdc.UUCP> Date: Wed, 26-Nov-86 18:50:19 EST Article-I.D.: ttrdc.1356 Posted: Wed Nov 26 18:50:19 1986 Date-Received: Thu, 27-Nov-86 01:57:52 EST References: <1376@umd5> Distribution: net Organization: AT&T, Computer Systems Division, Skokie, IL Lines: 59 Keywords: consensus,account-name Xref: mnetor comp.unix.questions:199 comp.unix.wizards:192 In article <1376@umd5>, cgs@umd5.UUCP writes: >The consensus of opinion is the environment is getting trashed. I'm going >to have to see what I can do with "dbx". It's strange that the environment >is getting trashed when I don't pass **envp to the program, and I never >attempt to do anything to the environment via a system() call. >Since I've received a note that I'm not the only one to have noticed this, >I'm including the following response I received for everyone's benefit: > >I've tried to do system("printenv"), but that too generates the error. >So, I'm left with poking around with "dbx" until I find out what is >going on. >.. And hast thou slain the Jabberwock? .. You could try something like replacing system() with code which actually prints out the environment, since printenv may filter out garbage even if invoked directly via execlp() (I don't have BSD src handy here, but SysV env filters out environment garbage). E.g.: extern char **environ; #define system(stuff) \ { \ int ep=0; \ while(environ[ep]) \ (void) printf("%s\n",environ[ep++]); \ } Question: does the code do any writing into its argument vector? Or question- able indexing upon automatic arrays? On SysV on a 3B20, the following will evoke your "00: not an identifier" diagnostic: main(argc,argv) char **argv; { argv[argc+1]="00"; /* messing with invalid argument */ (void) system("echo hello, world"); } So will this, after a few iterations (eventually core dumping): main() { auto char *c[1]; register int i=0; while (1) { c[--i]="00"; /* messing with stack */ (void) system("echo hello, world"); } } "hope this helps" -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, go for it! allegra,ulysses,vax135}!ttrdc!levy