Closed
Bug 1376567
Opened 7 years ago
Closed 3 years ago
Calling fork() during shutdown on Mac leads to a crash due to memory allocations
Categories
(Core :: Memory Allocator, defect, P3)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: gsvelto, Unassigned)
References
Details
(Keywords: crash)
This is something we've experienced dealing with the crashreporter client as well as the pingsender. Apparently fork() on Mac is doing some memory allocations (possibly related to locking) so if it gets called late enough during shutdown it crashes the parent process.
Reporter | ||
Comment 1•7 years ago
|
||
Ted, I can't find the bug where we hit this. Do you remember which one it was? It would be great to have that stack trace showing the problem in action.
Flags: needinfo?(ted)
Comment 3•7 years ago
|
||
From my reading of the crash stacks from that bug, it looked like something was going wrong with the way jemalloc hooked into the system heap. attachment 8858399 [details] shows the forked process was crashing in libsystem_malloc in nano_reinit_lock by way of libSystem_atfork_child. I don't really know enough about our jemalloc implementation or OS X's system malloc to say anything more useful here, but I'd guess that something jemalloc is doing is not fork-safe.
Reporter | ||
Comment 4•7 years ago
|
||
Mike, we spoke about this during the all-hands closing party, in case you want to have a look :)
Flags: needinfo?(mh+mozilla)
Updated•7 years ago
|
Updated•7 years ago
|
Reporter | ||
Comment 5•7 years ago
|
||
Clearing the needinfo since we've moved the affected code to use posix_spawnp(). Since fork() has other issues on Mac this is probably not worth investigating.
Flags: needinfo?(mh+mozilla)
Updated•6 years ago
|
Type: enhancement → defect
Updated•5 years ago
|
Priority: -- → P3
Hi gabriele, we are checking on really old bugs trying to find what can be closed either because of old functionality or something that has been fixed already on latest versions. I would like to know if this bug is still happening or is there any newer crash report link?
should we keep it open?
thanks
Flags: needinfo?(gsvelto)
Reporter | ||
Comment 7•3 years ago
|
||
The bug is still valid, we just avoid using fork()
on macOS. Feel free to close this given we simply try to avoid triggering this bug in new code.
Flags: needinfo?(gsvelto)
per last comment, changing bug to resolved WFM
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•