<?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>254413</bug_id>
          
          <creation_ts>2023-03-24 06:28:11 -0700</creation_ts>
          <short_desc>[WASM] Aborted in JSC::Wasm::B3IRGenerator::emitStructSet</short_desc>
          <delta_ts>2024-01-30 16:31:20 -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>
          
          
          <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>1943707</commentid>
    <comment_count>0</comment_count>
    <who name="CAO ZONG">cz18811105578</who>
    <bug_when>2023-03-24 06:28:11 -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,169,128,128,128,0,4,80,0,95,4,124,0,126,0,126,0,123,0,80,0,96,3,127,127,127,1,127,96,0,0,80,0,96,9,123,107,0,127,127,127,127,127,127,127,1,127,3,130,128,128,128,0,1,1,4,137,128,128,128,0,2,112,1,1,8,111,1,0,0,5,132,128,128,128,0,1,1,16,32,13,131,128,128,128,0,1,0,2,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,184,128,128,128,0,1,54,0,65,0,253,15,68,0,0,0,0,0,0,0,0,66,0,66,0,65,0,253,15,251,7,0,65,0,65,0,65,0,65,0,65,0,65,0,65,0,2,3,26,26,26,26,26,26,26,26,26,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  0x00005555569e06ff in JSC::Wasm::B3IRGenerator::emitStructSet(JSC::B3::Value*, unsigned int, JSC::Wasm::StructType const&amp;, JSC::B3::Value*) ()
#4  0x00005555569e4954 in JSC::Wasm::B3IRGenerator::addStructNew(unsigned int, WTF::Vector&lt;JSC::B3::Variable*, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;, JSC::B3::Variable*&amp;) ()
#5  0x0000555556a2fa39 in JSC::Wasm::FunctionParser&lt;JSC::Wasm::B3IRGenerator&gt;::parseExpression() ()
#6  0x0000555556a1c7cb in JSC::Wasm::FunctionParser&lt;JSC::Wasm::B3IRGenerator&gt;::parseBody() ()
#7  0x0000555556a13045 in JSC::Wasm::FunctionParser&lt;JSC::Wasm::B3IRGenerator&gt;::parse() ()
#8  0x00005555569ee926 in JSC::Wasm::parseAndCompileB3(JSC::Wasm::CompilationContext&amp;, JSC::Wasm::Callee&amp;, JSC::Wasm::FunctionData const&amp;, JSC::Wasm::TypeDefinition const&amp;, WTF::Vector&lt;JSC::Wasm::UnlinkedWasmToWasmCall, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;, JSC::Wasm::ModuleInformation const&amp;, JSC::MemoryMode, JSC::Wasm::CompilationMode, unsigned int, std::optional&lt;bool&gt;, unsigned int, JSC::Wasm::TierUpCount*) ()
#9  0x0000555556a03017 in JSC::Wasm::BBQPlan::compileFunction(unsigned int, JSC::Wasm::Callee&amp;, JSC::Wasm::CompilationContext&amp;, WTF::Vector&lt;JSC::Wasm::UnlinkedWasmToWasmCall, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;, JSC::Wasm::TierUpCount*) ()
#10 0x0000555556a01c92 in JSC::Wasm::BBQPlan::work(JSC::Wasm::Plan::CompilationEffort) ()
#11 0x0000555556b95272 in JSC::Wasm::Worklist::Thread::work() ()
#12 0x0000555556c4afa3 in WTF::Detail::CallableWrapper&lt;WTF::AutomaticThread::start(WTF::AbstractLocker const&amp;)::$_0, void&gt;::call() ()
#13 0x0000555556c6c1ef in WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) ()
#14 0x0000555556cc71d6 in WTF::wtfThreadEntryPoint(void*) ()
#15 0x00007ffff5fd9609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#16 0x00007ffff5ba6133 in clone () from /lib/x86_64-linux-gnu/libc.so.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943708</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-03-24 06:28:20 -0700</bug_when>
    <thetext>&lt;rdar://problem/107184303&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943817</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-03-24 11:58:49 -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>2008068</commentid>
    <comment_count>3</comment_count>
    <who name="Asumu Takikawa">asumu</who>
    <bug_when>2024-01-26 16:13:32 -0800</bug_when>
    <thetext>This bug depends on v128 support, so it should be fixed after https://github.com/WebKit/WebKit/pull/22727 lands. I will upload a test after that PR is merged.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2008637</commentid>
    <comment_count>4</comment_count>
    <who name="Asumu Takikawa">asumu</who>
    <bug_when>2024-01-29 13:44:37 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/23457</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2009144</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-01-30 16:31:16 -0800</bug_when>
    <thetext>Committed 273793@main (15a216e460c4): &lt;https://commits.webkit.org/273793@main&gt;

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

    </bug>

</bugzilla>