From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30296 invoked by alias); 18 Jun 2008 13:27:29 -0000 Received: (qmail 30289 invoked by uid 22791); 18 Jun 2008 13:27:28 -0000 X-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_20,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 18 Jun 2008 13:27:03 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m5IDR1IA020740 for ; Wed, 18 Jun 2008 09:27:01 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5IDR0XA020015; Wed, 18 Jun 2008 09:27:00 -0400 Received: from [127.0.0.1] (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5IDQxl6021001; Wed, 18 Jun 2008 09:27:00 -0400 Message-ID: <48590D25.90307@redhat.com> Date: Wed, 18 Jun 2008 23:12:00 -0000 From: Andrew Cagney User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Phil Muldoon CC: frysk@sourceware.org Subject: Re: vfork thoughts References: <48565AD5.8050902@redhat.com> In-Reply-To: <48565AD5.8050902@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00109.txt.bz2 Phil Muldoon wrote: > I've bee reading about vfork challenges for the past week. Here are my > thoughts. > > Mark when he fixed an issue related to breakpoints I think > crystallized the issue with vfork in this thread: > > http://article.gmane.org/gmane.comp.monitoring.frysk.general/1072 > > While at first the issue of breakpoints might seem to be nothing to do > with vfork(), it is very relevant. Literature suggests that the use of > vfork for any purpose other than an immediate prelude to an exec call > is not advisable. However, there could - and probably are - examples > of where this is not the case. Also as detailed in Mark's email this > makes the usage of breakpoints troublesome, as child and parent share > memory. Totally agree. > > If we model vfork transparently though the fork observer then there is > a danger of the user (be that an actual user, or an api call) assuming > that the it is a true fork and not a vfork. Is it more sensible to > model a completely separate set of observers to model vfork? This way, > if there are breakpoints set in the child (and therefore the parent) > we can uninstall them after the child execs. However this approach > burdens the state machine with additional states that would > essentially duplicate the fork states. Is the replication of code to > deal with the vfork specific issues warranted here? > > If anyone has a real life use case for debugging a vfork scenario we > could model, that would help also. Perhaps look at the fork/daemon code. It uses a vfork, followed by a fork, followed by an exec. Stepping through that would be way cool! > > Regards > > Phil > >