<?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>254414</bug_id>
          
          <creation_ts>2023-03-24 06:30:05 -0700</creation_ts>
          <short_desc>[WASM] Aborted in JSC::Wasm::LLIntGenerator::addCatchToUnreachable</short_desc>
          <delta_ts>2024-02-01 15:12:41 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</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>
          
          <blocked>247394</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="CAO ZONG">cz18811105578</reporter>
          <assigned_to name="Asumu Takikawa">asumu</assigned_to>
          <cc>asumu</cc>
    
    <cc>bfulgham</cc>
    
    <cc>justin_michaud</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1943710</commentid>
    <comment_count>0</comment_count>
    <who name="CAO ZONG">cz18811105578</who>
    <bug_when>2023-03-24 06:30:05 -0700</bug_when>
    <thetext>Commit: cebd0f9727d7493fbbea4ebf321799bc0152642e
Flags:  --useSinglePassBBQJIT=true --useWebAssemblyTypedFunctionReferences=true --useWebAssemblyGC=true

POC:
```
var wasm_code = new Uint8Array([0,97,115,109,1,0,0,0,1,157,128,128,128,0,5,80,0,95,0,80,0,96,3,127,127,127,1,127,96,1,108,1,0,96,4,126,123,123,123,0,96,0,0,3,130,128,128,128,0,1,1,4,133,128,128,128,0,1,112,1,1,3,5,132,128,128,128,0,1,1,16,32,13,135,128,128,128,0,3,0,2,0,3,0,4,7,136,128,128,128,0,1,4,109,97,105,110,0,0,9,139,128,128,128,0,1,6,0,65,0,11,112,1,210,0,11,10,176,128,128,128,0,1,46,0,6,127,65,0,68,0,0,0,0,0,0,0,0,65,0,65,0,54,2,138,162,1,8,2,155,170,69,254,44,2,178,228,148,136,5,7,0,26,65,0,25,65,0,11,11]);
var wasm_module = new WebAssembly.Module(wasm_code);
var wasm_instance = new WebAssembly.Instance(wasm_module);
var f = wasm_instance.exports.main;
f();
```

Backtrace:
#0  0x00007ffff5aca00b in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff5aa9859 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x0000555555a4a11a in WTFCrashWithInfo(int, char const*, char const*, int) ()
#3  0x0000555556adaa41 in JSC::Wasm::LLIntGenerator::addCatchToUnreachable(unsigned int, JSC::Wasm::TypeDefinition const&amp;, JSC::Wasm::LLIntGenerator::ControlType&amp;, WTF::Vector&lt;JSC::VirtualRegister, 8ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;) ()
#4  0x0000555556ae937e in JSC::Wasm::FunctionParser&lt;JSC::Wasm::LLIntGenerator&gt;::parseUnreachableExpression() ()
#5  0x0000555556ae821b in JSC::Wasm::FunctionParser&lt;JSC::Wasm::LLIntGenerator&gt;::parseBody() ()
#6  0x0000555556ae309f in JSC::Wasm::FunctionParser&lt;JSC::Wasm::LLIntGenerator&gt;::parse() ()
#7  0x0000555556ad1f72 in JSC::Wasm::parseAndCompileBytecode(unsigned char const*, unsigned long, JSC::Wasm::TypeDefinition const&amp;, JSC::Wasm::ModuleInformation&amp;, unsigned int) ()
#8  0x0000555556adfceb in JSC::Wasm::LLIntPlan::compileFunction(unsigned int) ()
#9  0x0000555556acddf0 in JSC::Wasm::EntryPlan::compileFunctions(JSC::Wasm::Plan::CompilationEffort) ()
#10 0x0000555556b95272 in JSC::Wasm::Worklist::Thread::work() ()
#11 0x0000555556c4afa3 in WTF::Detail::CallableWrapper&lt;WTF::AutomaticThread::start(WTF::AbstractLocker const&amp;)::$_0, void&gt;::call() ()
#12 0x0000555556c6c1ef in WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) ()
#13 0x0000555556cc71d6 in WTF::wtfThreadEntryPoint(void*) ()
#14 0x00007ffff5fd9609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#15 0x00007ffff5ba6133 in clone () from /lib/x86_64-linux-gnu/libc.so.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943711</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-03-24 06:30:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/107184325&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943816</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-03-24 11:58:17 -0700</bug_when>
    <thetext>&gt; --useWebAssemblyTypedFunctionReferences=true

This is not implemented fully &amp; not enabled. So, this is not a security issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2008649</commentid>
    <comment_count>3</comment_count>
    <who name="Asumu Takikawa">asumu</who>
    <bug_when>2024-01-29 14:10:43 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/23460</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2009906</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-02-01 15:12:27 -0800</bug_when>
    <thetext>Committed 273945@main (a7470b0dc92e): &lt;https://commits.webkit.org/273945@main&gt;

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

    </bug>

</bugzilla>