Bug 227964 - Speculative fix for failed scope.releaseAssertNoException() after calls to JSMap::create().
Summary: Speculative fix for failed scope.releaseAssertNoException() after calls to JS...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-14 12:50 PDT by Mark Lam
Modified: 2021-07-14 15:11 PDT (History)
7 users (show)

See Also:


Attachments
proposed patch. (4.51 KB, patch)
2021-07-14 12:59 PDT, Mark Lam
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
proposed patch. (4.86 KB, patch)
2021-07-14 13:03 PDT, Mark Lam
ysuzuki: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2021-07-14 12:50:55 PDT
There have been reports of flaky failures on the scope.releaseAssertNoException() after the call to JSMap::create() in JSModuleLoader::finishCreation().

The scope.releaseAssertNoException() says that we don't expect the JSMap::create() to ever throw an exception.  If the assertion is true, the only way that we can see an exception there is if we're throwing an asynchronous TerminationException.  Since JSModuleLoader::finishCreation() does have any long running loops, we can just DeferTerminationForAWhile and let the next exception check site throw the asynchronous TerminationException.  We don't want to just use DeferTermination because it will throw the TerminationException right at the end of JSModuleLoader::finishCreation(), and the caller of JSModuleLoader::finishCreation() may be similarly not expecting an exception to be thrown there.

Also apply the same treatment to AbstractModuleRecord::finishCreation(), and getBackingMap() in WebCore for the same reason.  Other than those, other sites that call JSMap::create() already check for exceptions.  So, those sites do not need to DeferTerminationForAWhile.

rdar://78013960
Comment 1 Mark Lam 2021-07-14 12:59:12 PDT
Created attachment 433520 [details]
proposed patch.
Comment 2 Mark Lam 2021-07-14 13:03:44 PDT
Created attachment 433522 [details]
proposed patch.
Comment 3 Yusuke Suzuki 2021-07-14 13:19:58 PDT
Comment on attachment 433522 [details]
proposed patch.

r=me
Comment 4 Mark Lam 2021-07-14 15:07:04 PDT
Thanks for the review.  I'm pretty sure the jsc test failures are due to Keith's patch, which he just landed a fix for.  So, I'm going to land this one.
Comment 5 Mark Lam 2021-07-14 15:11:18 PDT
Landed in r279924: <http://trac.webkit.org/r279924>.