From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12221 invoked by alias); 1 Dec 2008 20:56:30 -0000 Received: (qmail 12213 invoked by uid 22791); 1 Dec 2008 20:56:30 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Dec 2008 20:55:50 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 5676110DE7; Mon, 1 Dec 2008 20:55:48 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 4717D10CD3; Mon, 1 Dec 2008 20:55:48 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1L7Fo3-0005D9-D6; Mon, 01 Dec 2008 15:55:47 -0500 Date: Mon, 01 Dec 2008 20:56:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: Pedro Alves , "gdb-patches@sourceware.org" Subject: Re: Fix foll-fork.exp foll-vfork.exp fork-child-threads.exp Message-ID: <20081201205547.GA20007@caradoc.them.org> Mail-Followup-To: Michael Snyder , Pedro Alves , "gdb-patches@sourceware.org" References: <200811201328.13651.pedro@codesourcery.com> <493433D7.7080803@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <493433D7.7080803@vmware.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-12/txt/msg00011.txt.bz2 On Mon, Dec 01, 2008 at 10:58:31AM -0800, Michael Snyder wrote: > I'm not sure if this change goes far enough. > If a multi-threaded program forks, only the currently > executing thread survives in the child. All others are > left behind (and its not unlikely that the thread library > is left in an inconsistant state, possibly leading to > deadlocks). If you use fork () rather than syscall (SYS_fork), the thread library ought to clean up first; this is a POSIX supported functionality, I believe. I know it works with glibc and on Solaris. Of course, Solaris has rfork too which copies threads... -- Daniel Jacobowitz CodeSourcery