From owner-freebsd-hackers Tue Oct 2 14: 2: 5 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.yadt.co.uk (yadt.demon.co.uk [158.152.4.134]) by hub.freebsd.org (Postfix) with SMTP id 1E9D237B408 for ; Tue, 2 Oct 2001 14:01:56 -0700 (PDT) Received: (qmail 24687 invoked from network); 2 Oct 2001 21:01:53 -0000 Received: from unknown (HELO mail.gattaca.yadt.co.uk) (qmailr@10.0.0.2) by yadt.demon.co.uk with SMTP; 2 Oct 2001 21:01:53 -0000 Received: (qmail 28306 invoked by uid 1000); 2 Oct 2001 21:01:52 -0000 Date: Tue, 2 Oct 2001 22:01:52 +0100 From: David Taylor To: Alfred Perlstein Cc: Peter Pentchev , freebsd-hackers@FreeBSD.org Subject: Re: Doubt of system(3) Message-ID: <20011002220152.A3056@gattaca.yadt.co.uk> Mail-Followup-To: Alfred Perlstein , Peter Pentchev , freebsd-hackers@FreeBSD.org References: <200109291527.f8TFRrU76727.toshi@jp.FreeBSD.org> <20010929153433.U59854@elvis.mu.org> <20010929214338.A57903@gattaca.yadt.co.uk> <20010929221658.B57903@gattaca.yadt.co.uk> <20010929170332.Y59854@elvis.mu.org> <20010929232839.A91153@gattaca.yadt.co.uk> <20011002130942.C704@ringworld.oblivion.bg> <20011002112707.C59854@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011002112707.C59854@elvis.mu.org>; from bright@mu.org on Tue, Oct 02, 2001 at 11:27:07 -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 02 Oct 2001, Alfred Perlstein wrote: > * Peter Pentchev [011002 05:21] wrote: > > On Sat, Sep 29, 2001 at 11:28:39PM +0100, David Taylor wrote: > > [snip] > > > IMO, the below patch is probably the best solution. > > > > Yep, it also fixes the fact that the return value from wait4() needs > > to be preserved, at least for the return statement of __system(). > > Aaaaaaaaaaah! Forgot about it, I'm going to upgrade my workstation > now and commit it if it works, probably tonight. > > If someone else can test it earlier, by all means commit it. Just to say that as I did a make world today, I took the opportunity to test the patch, and it does fix the bug. (Old behaviour: davidt@gattaca:~/C/system-bug$ ./test Parent: Child A pid = 26271 Calling system... Child A: exiting Child B running - pid 26273 Child B: Sending parent (26270) SIGFPE to interrupt wait... System has returned Child B entering busy loop... Child B still running... Parent exiting - child b should have also exited... davidt@gattaca:~/C/system-bug$ Child B still running... killall test2 Terminated New behaviour: davidt@gattaca:~/C/system-bug$ ./test Parent: Child A pid = 27944 Calling system... Child A: exiting Child B running - pid 27946 Child B: Sending parent (27943) SIGFPE to interrupt wait... Child B entering busy loop... Child B still running... Child B still running... Child B still running... ^Z [1]+ Stopped ./test davidt@gattaca:~/C/system-bug$ bg [1]+ ./test & davidt@gattaca:~/C/system-bug$ Child B still running... kill 27946 Terminated System has returned Parent exiting - child b should have also exited... davidt@gattaca:~/C/system-bug$ ) However, I won't be able to commit it, since I'm not a committer :) -- David Taylor davidt@yadt.co.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message