This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFC: Deadlock in multithreaded application when doing IO andfork.
- From: Rich Felker <dalias at aerifal dot cx>
- To: libc-alpha at sourceware dot org
- Date: Fri, 1 Feb 2013 15:53:20 -0500
- Subject: Re: RFC: Deadlock in multithreaded application when doing IO andfork.
- References: <510AF80E.5020400@redhat.com>
On Thu, Jan 31, 2013 at 06:02:38PM -0500, Carlos O'Donell wrote:
> Community,
>
> I've seen what I believe to be the following deadlock
> scenario in a multithreaded application when doing
> IO and forking.
>
> It is safe to call fork in a multthreaded environment.
But not safe to use async-signal-unsafe functions in the child after
fork. In particular, malloc is not legal after fork in a
multi-threaded program, so the simplest solution would be to remove
all the atfork handling for malloc.
I realize however this may be unpopular...
Rich