delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/12/16/13:59:44

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: <djgpp-workers AT delorie DOT com>
Subject: Weird system() thing (was Re: The Bash 2.05 fixinc.sh bug)
Date: Sun, 16 Dec 2001 19:59:58 +0100
Message-ID: <000e01c18663$db550130$d13276d5@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.2627
In-Reply-To: <10112160731.AA15388@clio.rice.edu>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
Importance: Normal
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> It can be reproduced in a nice 3 line makefile:
> 
> SHELL = /bin/sh
> all:
>         MAKE="$(MAKE)"
> 
> make on this with bash being 2.04 works fine, on 2.05 gives the binary
> file error (using bash 2.05 from cvs build directory on clio).  Yes,
> that's a tab before the MAKE.

I tried to see if this was relatd to system() in
any way, and clearly it was not (system("FOO=$FOO") works fine).

But I did find a different, very weird bug (which I don't recall being
mentioned before): while

int
main(void)
{
  system("");
}

and

int
main(void)
{
  system("Foo=bar");
}


both, as expected, spawn a single instance of command.com, and exit
after
that shell is exited, the following does not:

int
main(void)
{
  system("");
  system("Foo=bar");
}

I'd expect this to run command.com, when that's exited run it again, and
then exit.  But instead I get a seemingly infinite series of
command.coms;
the only way to get out seems to be to type Ctrl-C, as that causes the
executable to SIGINT out after exiting the subshell.

This is with straight clio packages for djdev & gcc3.  It does not
happen
with two 'system("")' calls.

- Raw text -


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