From owner-cvs-usrbin Thu Apr 24 12:20:37 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA25316 for cvs-usrbin-outgoing; Thu, 24 Apr 1997 12:20:37 -0700 (PDT) Received: from Sisyphos.MI.Uni-Koeln.DE (Sisyphos.MI.Uni-Koeln.DE [134.95.212.10]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id MAA25311; Thu, 24 Apr 1997 12:20:30 -0700 (PDT) Received: from x14.mi.uni-koeln.de (annexr3-8.slip.Uni-Koeln.DE) by Sisyphos.MI.Uni-Koeln.DE with SMTP id AA01242 (5.67b/IDA-1.5); Thu, 24 Apr 1997 21:20:27 +0200 Received: (from se@localhost) by x14.mi.uni-koeln.de (8.8.5/8.6.9) id UAA06732; Thu, 24 Apr 1997 20:04:45 +0200 (CEST) Message-Id: <19970424200444.24901@x14.mi.uni-koeln.de> Date: Thu, 24 Apr 1997 20:04:44 +0200 From: Stefan Esser To: Bruce Evans Cc: ache@freebsd.org, cvs-all@freebsd.org, CVS-committers@freebsd.org, cvs-usrbin@freebsd.org Subject: vfork problem in gcc (was: Re: cvs commit: src/usr.bin/vacation vacation.c) References: <199704240959.TAA12833@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.68 In-Reply-To: <199704240959.TAA12833@godzilla.zeta.org.au>; from Bruce Evans on Thu, Apr 24, 1997 at 07:59:41PM +1000 Sender: owner-cvs-usrbin@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Apr 24, Bruce Evans wrote: > > Modified: usr.bin/vacation vacation.c > > Log: > > Better fix: return vfork() again, but remove clobbering fclose() > > and use _exit() instead of exit() > > I think it's better to use fork() except in programs that fork a lot. > Even the simplest use: > > if ((pid = vfork()) == 0) > execl(...); > > is not guaranteed to work (it depends on there being a stack frame and > the compiler not doing anything unusual with it). I had just fail "gcc -pipe" with an "vfork: interrupted system call" (from memory) message. This happened reproducible with one certain source file, removing "-pipe" allowed to compile that file, too ... This might affect people doing a "make world" with "-pipe", I guess. There is only one use of vfork in gcc.c (on line 2061). Lots of files that are closed in the child, and it does call exit(), if the exec() fails ... Regards, STefan