Updates:
        Owner: [email protected]
        Cc: [email protected] [email protected] [email protected]
        Labels: -Priority-Medium Priority-High

Comment #5 on issue 2874 by [email protected]: Threading problems in test-api
http://code.google.com/p/v8/issues/detail?id=2874

After extensive debugging, we just discovered that this bug is caused by the design of the CPU profiler. We have the following scenario:

1. The JavaScript thread is executing some C++ function, which calls into one of the Isolate methods that aquire the mutex in Isolate.
2. Then the sampler thread sends a SIGPROF to the JavaScript thread.
3. The JavaScript thread enters the signal handler while the mutex is locked. 4. The signal handler (in the JavaScript thread) tries to acquire the mutex again to gain access to the Simulator, which fails (of course).

This bug was there forever, but it probably showed up as seldom mysterious crasher, which was not reproducible. It is now almost reproducible because (a) we actually check the result of synchronization primitives and (b) the profiling interval was reduced to 1ms.

Note that this particular bug affects only the simulators, and we may get around this by simply disabling profile if USE_SIMULATOR is defined.

But while looking through the code, we discovered that there are other issues that'll affect production code. For example, we assume that pthread_getspecific() is async-signal-safe, which seems to hold for the current implementation in glibc (NTPL), but is by no means guaranteed (not even talking about Mac OS X, *BSD, Solaris, etc. here).


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to