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.
On Fri, Feb 01, 2013 at 01:01:38PM -0800, Roland McGrath wrote:
> > 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.
>
> The issues at hand are in the atfork handlers that run in the parent.
> There are no restrictions on what calls those can make.
I'm not claiming it's disallowed to poke with malloc in the parent.
I'm claiming it's useless to use atfork handlers to attempt to give
the child a consistent malloc state because the child is not allowed
to use malloc anyway.
Rich