[RFC] Hang on free-during-fork with LinuxThreads

Jason Evans jasone at canonware.com
Tue May 20 12:36:54 PDT 2014


On May 13, 2014, at 2:41 PM, Leonard Crestez <lcrestez at ixiacom.com> wrote:
> Some time ago I ported jemalloc to work on old systems still using LinuxThreads. See this thread: http://jemalloc.net/mailman/jemalloc-discuss/2013-October/000646.html
> 
> It seems that with LinuxThreads the fork() implementation will call free during fork, between jemalloc_prefork and jemalloc_postfork_child.

That’s terrible; LinuxThreads shouldn’t do that!  Can you change LinuxThreads to just leak, or perhaps defer the free() call until after jemalloc_postfork_child()?  As for hacks in jemalloc, you could make it ignore free() calls during forking, but that’s expensive enough that it’s not useful as a generic solution.

Jason


More information about the jemalloc-discuss mailing list