PR# 14516 Routine `eif_system_asynchronous' calls fork instead of eif_thread_fork

Problem Report Summary
Submitter: prestoat2000
Category: Runtime
Priority: Medium
Date: 2008/06/23
Class: Bug
Severity: Serious
Number: 14516
Release: 6.2.73753
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.13) Gecko/20080328 Firefox/2.0.0.13 Solaris 10 on SPARC
Synopsis: Routine `eif_system_asynchronous' calls fork instead of eif_thread_fork

Description
Routine `eif_system_asynchronous' in misc.c calls `fork' instead of
`eif_thread_fork'.  This can cause problems, as I learned when making eweasel
multithreaded.  From my e-mail relating to this problem:

My theory is that when the thread that was supposed to run the test called fork,
another thread was requesting a GC.  After the fork, only the calling
thread is replicated in the new process.  It then calls a routine, which checks via RTGC
whether another thread is requesting GC (eif_is_gc_collecting).  The answer is yes,
so it calls eif_synchronize_gc.  It then tries to lock eif_gc_mutex but this mutex
is already locked and will never be unlocked since the thread holding the lock was
not replicated by the fork.  So the (only) thread in the child process blocks forever. 
To Reproduce

										
Problem Report Interactions