delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/08/17/17:17:51

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Esa A E Peuha <esa DOT peuha AT helsinki DOT fi>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: That BASH crash, revisited
Date: 18 Aug 2006 00:02:16 +0300
Organization: University of Helsinki
Lines: 21
Message-ID: <86p3bbv6ppj.fsf@sirppi.helsinki.fi>
References: <OF61A52282 DOT CB39175D-ON872571C4 DOT 006931B1-872571C4 DOT 0070EA32 AT seagate DOT com> <44e21a48$0$489$cc7c7865 AT news DOT luth DOT se>
NNTP-Posting-Host: sirppi.helsinki.fi
X-Trace: oravannahka.helsinki.fi 1155848536 862 128.214.205.27 (17 Aug 2006 21:02:16 GMT)
X-Complaints-To: abuse AT helsinki DOT fi
NNTP-Posting-Date: 17 Aug 2006 21:02:16 GMT
X-Newsreader: Gnus v5.6.43/Emacs 19.34
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Martin Str|mberg <ams AT speedy DOT ludd DOT ltu DOT se> writes:

> Doing that, it reveals to me that it seems to be some kind of
> corruption that happens somewhere in excute_cmd.c:
> execute_simple_command() or in what is called from there. A watchpoint
> tells me that it's changed in nofork.c: nofork_save_all_environment()
> and nofork_restore_all_environment(). But that does not seem to be the
> place of corruption.

It _is_ the place of corruption.  The function command_substitute() does
setjmp(return_catch) before it executes the command, but it doesn't
restore the old value of return_catch afterwards, so any longjmp to
return_catch goes back inside command_substitute() even after it has
returned.  This is no problem on other platforms, becuse the function
will just exit, but on DJGPP it calls nofork_restore_all_environment()
again, which pretty much destroys the environment.

-- 
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019