<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>284244</bug_id>
          
          <creation_ts>2024-12-07 23:10:48 -0800</creation_ts>
          <short_desc>ASSERTION FAILED: !waiter-&gt;isOnList() in JavaScriptCore</short_desc>
          <delta_ts>2024-12-10 09:26:02 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="EntryHi">entryhii</reporter>
          <assigned_to name="Yijia Huang">yijia_huang</assigned_to>
          <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>yijia_huang</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2079968</commentid>
    <comment_count>0</comment_count>
    <who name="EntryHi">entryhii</who>
    <bug_when>2024-12-07 23:10:48 -0800</bug_when>
    <thetext>Hello, I found a crash in JavaScriptCore.

The PoC is shown as below:

============================poc.js========================
class C0 {}
const v1 = new C0();
for (let i = 0; i &lt; 10; i++) {
        const v25 = new SharedArrayBuffer(3614, {&quot;maxByteLength&quot;: 3614,});
        const v27 = new Int32Array(v25);
        let originalPrototype = Object.getPrototypeOf(v27);
        let handler = {
            get(target, key, receiver) {
                if ( receiver === v27) return originalPrototype;
            }
        };
        let newPrototype = new Proxy(originalPrototype, handler);
        Object.setPrototypeOf(v27, newPrototype);
        function f28() {
            try { v1.m(); } catch (e) {}
            for (let v31 = 0; v31 &lt; 5; v31++) {}
        }
        v27[Symbol.toPrimitive] = f28;
        createGlobalObject().Atomics.waitAsync(v27, 200, v27, 200);
}
gc();
=========================================================


Reproduce bug: 1. Compile JavaScriptCore in Debug mode.
                           2. Run jsc: ./jsc -f poc.js --thresholdForJITSoon=10 --thresholdForJITAfterWarmUp=10 --thresholdForOptimizeAfterWarmUp=100 --useConcurrentJIT=0

Backtrace:
* thread #1, name = &apos;jsc&apos;, stop reason = signal SIGABRT
  * frame #0: 0x00007ffff2c38884 libc.so.6`__pthread_kill_implementation + 276
    frame #1: 0x00007ffff2be7afe libc.so.6`raise + 30
    frame #2: 0x00007ffff2bd087f libc.so.6`abort + 223
    frame #3: 0x00007ffff547320a libJavaScriptCore.so.1`WTFCrashWithInfo((null)=193, (null)=&quot;WebKit-https/WebKit_validate/Source/JavaScriptCore/runtime/WaiterListManager.cpp&quot;, (null)=&quot;void JSC::WaiterListManager::timeoutAsyncWaiter(void *, Ref&lt;JSC::Waiter&gt; &amp;&amp;)&quot;, (null)=3555) at Assertions.h:913:5
    frame #4: 0x00007ffff691da56 libJavaScriptCore.so.1`JSC::WaiterListManager::timeoutAsyncWaiter(this=&lt;unavailable&gt;, ptr=&lt;unavailable&gt;, waiter=&lt;unavailable&gt;) at WaiterListManager.cpp:193:5
    frame #5: 0x00007ffff6e3ffd4 libJavaScriptCore.so.1`WTF::Detail::CallableWrapper&lt;WTF::RunLoop::dispatchAfter(WTF::Seconds, WTF::Function&lt;void ()&gt;&amp;&amp;)::$_2, void&gt;::call() [inlined] WTF::Function&lt;void ()&gt;::operator()(this=&lt;unavailable&gt;) const at Function.h:82:35
    frame #6: 0x00007ffff6e3ffc5 libJavaScriptCore.so.1`WTF::Detail::CallableWrapper&lt;WTF::RunLoop::dispatchAfter(WTF::Seconds, WTF::Function&lt;void ()&gt;&amp;&amp;)::$_2, void&gt;::call() [inlined] WTF::RunLoop::dispatchAfter(WTF::Seconds, WTF::Function&lt;void ()&gt;&amp;&amp;)::$_2::operator()(this=&lt;unavailable&gt;) at RunLoop.cpp:179:9
    frame #7: 0x00007ffff6e3ffb0 libJavaScriptCore.so.1`WTF::Detail::CallableWrapper&lt;WTF::RunLoop::dispatchAfter(WTF::Seconds, WTF::Function&lt;void ()&gt;&amp;&amp;)::$_2, void&gt;::call(this=&lt;unavailable&gt;) at Function.h:53:39
    frame #8: 0x00007ffff6f02d2e libJavaScriptCore.so.1`WTF::RunLoop::runImpl(WTF::RunLoop::RunMode) [inlined] WTF::RunLoop::TimerBase::ScheduledTask::fired(this=0x00007fffe90267c0) at RunLoopGeneric.cpp:64:17
    frame #9: 0x00007ffff6f02cbe libJavaScriptCore.so.1`WTF::RunLoop::runImpl(this=0x00007fffe90080e0, runMode=Drain) at RunLoopGeneric.cpp:219:19
    frame #10: 0x0000555555569df4 jsc`int runJSC&lt;jscmain(int, char**)::$_9&gt;(options=0x00005555555e2c70, isWorker=false, func=&lt;unavailable&gt;) at jsc.cpp:4300:31
    frame #11: 0x0000555555566e33 jsc`jscmain(argc=9, argv=0x00007fffffffd5a8) at jsc.cpp:4499:18
    frame #12: 0x0000555555566a40 jsc`main(argc=9, argv=0x00007fffffffd5a8) at jsc.cpp:3573:15
    frame #13: 0x00007ffff2bd1b8a libc.so.6`__libc_start_call_main + 122
    frame #14: 0x00007ffff2bd1c4b libc.so.6`__libc_start_main@@GLIBC_2.34 + 139
    frame #15: 0x0000555555562895 jsc`_start + 37

ASSERTION FAILED: !waiter-&gt;isOnList() WebKit-https/WebKit_validate/Source/JavaScriptCore/runtime/WaiterListManager.cpp(193) : void JSC::WaiterListManager::timeoutAsyncWaiter(void *, Ref&lt;JSC::Waiter&gt; &amp;&amp;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080281</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-12-09 12:41:03 -0800</bug_when>
    <thetext>&lt;rdar://problem/141173936&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080294</commentid>
    <comment_count>2</comment_count>
    <who name="Yijia Huang">yijia_huang</who>
    <bug_when>2024-12-09 13:06:34 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/37657</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080520</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-12-10 09:26:00 -0800</bug_when>
    <thetext>Committed 287611@main (4769bb5d4e99): &lt;https://commits.webkit.org/287611@main&gt;

Reviewed commits have been landed. Closing PR #37657 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>