Bug 274749

Summary: The stack-overflow-in-syntax-checker.js JSC stress test is flaky.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: 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
Reported 2024-05-27 03:04:43 PDT
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
Mark Lam
Comment 1 2024-05-27 03:11:41 PDT
EWS
Comment 2 2024-05-28 07:49:25 PDT
Committed 279380@main (866927170c08): <https://commits.webkit.org/279380@main> Reviewed commits have been landed. Closing PR #29145 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.