Bug 274749
Summary: | The stack-overflow-in-syntax-checker.js JSC stress test is flaky. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> |
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Mark Lam
We observed that the stack-overflow-in-syntax-checker.js test is flaky. After a lot of investigation, the issue turns out to be a test issue:
1. The test starts a worker thread using $262.agent.start.
2. The worker thread will always fail to parse its script: the script will cause the parser will recurse too deeply, thereby resulting in a StackOverflowError.
3. Since the StackOverflowError occurs during parsing, adding a try-catch block around the worker payload script (in 279015@main) does not help.
4. If the worker thread throws the StackOverflowError, and propagate it all the way out, resulting in an uncaught exception before the main thread terminates, this will result in the process exiting with EXIT_FAILURE. The test fails.
5. On the other hand, if the main thread finishes first before the worker thread can exit with EXIT_FAILURE, then the test passes.
The test is flaky because its result is dependent on whether the main thread or the worker thread wins the race.
This purpose of this test is to ensure that the stack overflow in the parser does not result in a crash. Hence, whether we get an uncaught exception or not is irrelevant and should not fail the test.
The fix is to add a new `--ignoreUncaughtExceptions` option to the jsc shell, and require that option for this test.
rdar://128786930
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mark Lam
Pull request: https://github.com/WebKit/WebKit/pull/29145
EWS
Committed 279380@main (866927170c08): <https://commits.webkit.org/279380@main>
Reviewed commits have been landed. Closing PR #29145 and removing active labels.