From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1238 invoked by alias); 28 Nov 2004 17:55:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1166 invoked from network); 28 Nov 2004 17:55:08 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 28 Nov 2004 17:55:08 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CYTGM-0006Yi-2y; Sun, 28 Nov 2004 12:55:06 -0500 Date: Sun, 28 Nov 2004 17:55:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] To fork or to vfork Message-ID: <20041128175506.GF24639@nevyn.them.org> Mail-Followup-To: Mark Kettenis , gdb-patches@sources.redhat.com References: <200411232217.iANMH3F9014455@elgar.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200411232217.iANMH3F9014455@elgar.sibelius.xs4all.nl> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-11/txt/msg00493.txt.bz2 On Tue, Nov 23, 2004 at 11:17:03PM +0100, Mark Kettenis wrote: > It's now pretty clear to me why HP-UX 11.xx needs -Dvfork=fork. In > order to set up a child to be traced using the HP-UX ttrace(2) system > call, it needs to do some handshaking. It uses two pipes to do this. > The child writes to one end to indicate that it's ready to be traced. > When the parent is able to read from the other end it will set things > up such that the child is properly traced. It then indicates that the > child may continue by writing on the other pipe. However, since the > parent is suspended while the child is in the vforked state, this > doesn't work, and the debugger hangs. > > Now I think we all agree that the -Dvfork=fork is pretty ugly. Here's > an alternate approach. It's pretty likely that if PRE_TRACE_FUN is > non-null things are complicated enough that it's unlikely that a vfork > will work correctly. I therefore propose the attached patch. > > If there are no objections, I'll check this in in a few days. No objections - this sounds like a great reason to use fork. We're already stretching (read: way past) what is guaranteed to work after vfork, and it's bitten us before, but the optimization is so important on some targets... -- Daniel Jacobowitz