Re: Fix foll-fork.exp foll-vfork.exp fork-child-threads.exp

Michael Snyder
2008-12-01T22:36:20Z

Daniel Jacobowitz wrote:
> 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...
>

All right, but separate from that, shouldn't gdb clean up too?
At least do a prune-threads?