Bug 241927

Summary: Watchdog doesn't work as expected for some tail calls
Product: WebKit Reporter: Yijia Huang <yijia_huang>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: mark.lam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Yijia Huang 2022-06-23 12:50:10 PDT
Options "--watchdog=1000 --watchdog-exception-ok" suppose to let jsc terminate a hanging Javascript program with a time out 1000ms. However, the options fail on this example with a ToT build.
```
function foo(a) {
    'use strict';
    return foo(a, 0);
}

foo(1);
```
Comment 1 Mark Lam 2022-06-23 14:50:06 PDT
Looks like global common subexpression elimination eliminated an InvalidationPoint.  That's the reason the watchdog wasn't able to terminate the script.
Comment 2 Yijia Huang 2022-06-28 16:42:49 PDT
We added a --usePollingTraps=true option to stress test call-link-info-osrexit-repatch.js as a workaround. We should remove that once we fix this problem.
Comment 3 Radar WebKit Bug Importer 2022-06-30 12:51:12 PDT
<rdar://problem/96239507>