Title: [184884] trunk/Source/_javascript_Core
Revision
184884
Author
[email protected]
Date
2015-05-26 15:59:38 -0700 (Tue, 26 May 2015)

Log Message

Photo Booth hangs under JSC::MachineThreads::tryCopyOtherThreadStacks
https://bugs.webkit.org/show_bug.cgi?id=145395

Reviewed by Mark Hahnenberg.

No test case because we already have --threaded mode, which runs lots of
parallel GC, but it (and the original in-app test case) can't reproduce
this bug.

* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::tryCopyOtherThreadStacks): Use a lock to prevent
two threads from mutually suspending each other.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (184883 => 184884)


--- trunk/Source/_javascript_Core/ChangeLog	2015-05-26 22:48:13 UTC (rev 184883)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-05-26 22:59:38 UTC (rev 184884)
@@ -1,3 +1,18 @@
+2015-05-26  Geoffrey Garen  <[email protected]>
+
+        Photo Booth hangs under JSC::MachineThreads::tryCopyOtherThreadStacks
+        https://bugs.webkit.org/show_bug.cgi?id=145395
+
+        Reviewed by Mark Hahnenberg.
+
+        No test case because we already have --threaded mode, which runs lots of
+        parallel GC, but it (and the original in-app test case) can't reproduce
+        this bug.
+
+        * heap/MachineStackMarker.cpp:
+        (JSC::MachineThreads::tryCopyOtherThreadStacks): Use a lock to prevent
+        two threads from mutually suspending each other.
+
 2015-05-26  Yusuke Suzuki  <[email protected]>
 
         Add Array.prototype.copyWithin to JSC features.json

Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (184883 => 184884)


--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp	2015-05-26 22:48:13 UTC (rev 184883)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp	2015-05-26 22:59:38 UTC (rev 184884)
@@ -563,6 +563,11 @@
 
 bool MachineThreads::tryCopyOtherThreadStacks(MutexLocker&, void* buffer, size_t capacity, size_t* size)
 {
+    // Prevent two VMs from suspending each other's threads at the same time,
+    // which can cause deadlock: <rdar://problem/20300842>.
+    static StaticSpinLock mutex;
+    std::lock_guard<StaticSpinLock> lock(mutex);
+
     *size = 0;
 
     PlatformThread currentPlatformThread = getCurrentPlatformThread();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to