Closed Bug 498166 Opened 13 years ago Closed 6 years ago
_init deadlock due to pthread _atfork
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:22.214.171.124) Gecko/20081204 SeaMonkey/1.1.14 Build Identifier: http://download.mozilla.org/?product=firefox-3.5b4&os=linux&lang=de malloc_init_hard calls pthread_atfork which in turn may call malloc => deadlock Both the nptl and the linuxthreads implementation of pthread_atfork allocate memory on the fly. On nptl we don't observe this bug because pthread_atfork has an initial pool and allocation happens in chunks of 48 entries. On linuxthreads malloc is called everytime. Reproducible: Always Steps to Reproduce: 1. run a linux system with linuxthreads instead of nptl 2. start firefox Actual Results: - system becomes idle - no window, no message in terminal - process sleeps in pthread_mutex_lock(&init_lock) Expected Results: - a browser window opens Moving the call to pthread_atfork between malloc_initialized = true; and malloc_mutex_unlock(&init_lock); should fix the bug.
We have encountered this problem too, when bringing-up FxOS on a device. The suggested approach from Daniel fixes the problem (attached patch).
Attachment #8609331 - Flags: review?(mh+mozilla)
Attachment #8609331 - Flags: review?(mh+mozilla) → review+
You need to log in before you can comment on or make changes to this bug.