This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Deadlock in multithreaded application when doing IO andfork.


On Fri, Feb 01, 2013 at 04:30:16PM -0500, KOSAKI Motohiro 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.
> 
> 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.

That's why I said my solution might not be popular. I think OpenJDK
should be fixed to avoid this UB, but I agree if you have applications
working now, it's somewhat unreasonable to say "what you're doing is
UB, so we're going to break it now" without giving them ample warning
and time to correct their programs...

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]