This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Fix foll-fork.exp foll-vfork.exp fork-child-threads.exp
- From: Daniel Jacobowitz <drow at false dot org>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: Pedro Alves <pedro at codesourcery dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 1 Dec 2008 15:55:47 -0500
- Subject: Re: Fix foll-fork.exp foll-vfork.exp fork-child-threads.exp
- References: <200811201328.13651.pedro@codesourcery.com> <493433D7.7080803@vmware.com>
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