ASSERTION FAILED: vm->currentThreadIsHoldingAPILock() seen with http/tests/paymentreq...
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Feb 2018 04:10:09 +0000 (04:10 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Feb 2018 04:10:09 +0000 (04:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182591

Reviewed by Youenn Fablet.

Fixes assertion failures in http/tests/paymentrequest/payment-request-show-method.https.html.

DOMPromise::whenSettled() calls the JSC API without first aquiring the API lock, and
r228195 added a call to whenSettled() where the lock is not guaranteed to be already
acquired.

Fix this by creating a JSLockHolder in DOMPromise::whenSettled().

* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenSettled):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228258 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMPromise.cpp

index a6c101a..63867bb 100644 (file)
@@ -1,3 +1,21 @@
+2018-02-07  Andy Estes  <aestes@apple.com>
+
+        ASSERTION FAILED: vm->currentThreadIsHoldingAPILock() seen with http/tests/paymentrequest/payment-request-show-method.https.html
+        https://bugs.webkit.org/show_bug.cgi?id=182591
+
+        Reviewed by Youenn Fablet.
+
+        Fixes assertion failures in http/tests/paymentrequest/payment-request-show-method.https.html.
+
+        DOMPromise::whenSettled() calls the JSC API without first aquiring the API lock, and
+        r228195 added a call to whenSettled() where the lock is not guaranteed to be already
+        acquired.
+
+        Fix this by creating a JSLockHolder in DOMPromise::whenSettled().
+
+        * bindings/js/JSDOMPromise.cpp:
+        (WebCore::DOMPromise::whenSettled):
+
 2018-02-07  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r228243.
index 0e3f428..928b3e1 100644 (file)
@@ -55,6 +55,7 @@ void DOMPromise::whenSettled(std::function<void()>&& callback)
 {
     auto& state = *globalObject()->globalExec();
     auto& vm = state.vm();
+    JSLockHolder lock(vm);
     auto* handler = JSC::JSNativeStdFunction::create(vm, globalObject(), 1, String { }, [callback = WTFMove(callback)] (ExecState*) mutable {
         callback();
         return JSC::JSValue::encode(JSC::jsUndefined());