On Fri, May 25, 2012 at 11:02 AM, Jokea <[email protected]> wrote: > I've found that a forked child runs into dead lock in a multithreaded > application.
Hello, just to add that this behavior also happens in Redis, so it is potentially affecting many users and we saw this bug happening in the real world. What appears to happen is that, since fork() only duplicates the thread calling it, if another thread happens to hold the lock at the time we fork(), the child will still have the lock as hold but no one will release it (since the other thread does not exist in the new process). Apparently just before forking() jemalloc should do something to make sure that no lock is hold. In the specific case of Redis, if this bug is not going to be fixed, we have the alternative of making sure allocation is not performed at the time we fork, but this is only currently possible because we do very little with threads. Cheers, Salvatore -- Salvatore 'antirez' Sanfilippo open source developer - VMware http://invece.org Beauty is more important in computing than anywhere else in technology because software is so complicated. Beauty is the ultimate defence against complexity. — David Gelernter _______________________________________________ jemalloc-discuss mailing list [email protected] http://www.canonware.com/mailman/listinfo/jemalloc-discuss
