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 and fork.
- From: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>
- To: Rich Felker <dalias at aerifal dot cx>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 1 Feb 2013 16:30:16 -0500
- Subject: Re: RFC: Deadlock in multithreaded application when doing IO and fork.
- References: <510AF80E.5020400@redhat.com> <20130201205320.GT20323@brightrain.aerifal.cx>
> 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.
But the simplest solution break several applications. Example, OpenJDK call
opendir("/proc/self/fd") when spawning new process and our opendir uses
malloc internally.
So, fixing rare race and breaking major application don't seem good deal,
at least to me.