-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Non-deterministic hanging for setTimeout and other async operations when using --prof (v0.12.x, OS X 10.9.5) #14576
Comments
Thank you for reporting this issue! This is the stack trace that I get for all threads:
I have tested that this would be fixed by upgrading to V8 3.29.93.1 or newer, but I haven't had the time to investigate if we could isolate a specific fix and land it without breaking V8's API for v0.12.x. |
It also occurs on SmartOS, it's definitely not specific to OSX. |
Same issue in here for Mac OSX. |
+1 |
A deadlock happens when sampler initiated by SIGPROF tries to lock the thread and the thread is already locked by the same thread. As a result, other thread involved in sampling process hangs. The patch adds a check for thread lock before continuing sampler operation. The fix has been tested on a sample app under load with and without profiling turned on. Fixes issue nodejs#14576 and specifically the duplicate issue nodejs#25295
@dmelikyan Thank you for #25309! As @mhdawson mentioned, @tunniclm will be reviewing your change asap. |
Reproduced this issue on Ubuntu 14.04.2 (x64) with Node v0.12.4. The patch #25309 has resolved the issue. |
@weekens Thank you for the heads up! |
A deadlock happens when sampler initiated by SIGPROF tries to lock the thread and the thread is already locked by the same thread. As a result, other thread involved in sampling process hangs. The patch adds a check for thread lock before continuing sampler operation. The fix has been tested on a sample app under load with and without profiling turned on. Fixes issue nodejs#14576 and specifically the duplicate issue nodejs#25295
A deadlock happens when sampler initiated by SIGPROF tries to lock the thread and the thread is already locked by the same thread. As a result, other thread involved in sampling process hangs. The patch adds a check for thread lock before continuing sampler operation. The fix has been tested on a sample app under load with and without profiling turned on. Fixes issue nodejs#14576 and specifically the duplicate issue nodejs#25295
A deadlock happens when sampler initiated by SIGPROF tries to lock the thread and the thread is already locked by the same thread. As a result, other thread involved in sampling process hangs. The patch adds a check for thread lock before continuing sampler operation. The fix has been tested on a sample app under load with and without profiling turned on. Fixes issue #14576 and specifically the duplicate issue #25295 Reviewed-By: Julien Gilli <[email protected]> PR-URL: #25309
Fixed by b81a643, thank you all 👍 |
setTimeout, fs.readFile and other async functions sometimes makes the entire node process hang permanently when the
--prof
flag is used on OS X.Environments where issue occurs:
Environments where issue does not occur:
To reproduce, run this script with node v.0.12.x on the path:
Sample output, hanging after 9 iterations:
The text was updated successfully, but these errors were encountered: