<?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>258796</bug_id>
          
          <creation_ts>2023-07-03 02:37:57 -0700</creation_ts>
          <short_desc>SHOULD NEVER BE REACHED in Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp(1189)</short_desc>
          <delta_ts>2024-02-14 10:38:07 -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>WebAssembly</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>xiangwei1895</reporter>
          <assigned_to name="Asumu Takikawa">asumu</assigned_to>
          <cc>d_degazio</cc>
    
    <cc>justin_michaud</cc>
    
    <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1964750</commentid>
    <comment_count>0</comment_count>
    <who name="">xiangwei1895</who>
    <bug_when>2023-07-03 02:37:57 -0700</bug_when>
    <thetext>## JavaScriptCore Version
1f2d2a92eeb831bedd01bbb5b694a0e29fa9af81

## Build 
Ubuntu 20.04.2 LTS (Linux 5.15.0-67-generic x86_64)
./Tools/Scripts/build-jsc --jsc-only --debug --build-dir=asan --cmakeargs=&quot;-DCMAKE_C_COMPILER=&apos;/usr/bin/clang&apos; -DCMAKE_CXX_COMPILER=&apos;/usr/bin/clang++&apos; -DCMAKE_CXX_FLAGS=&apos;-g -O3 -fsanitize=address&apos;&quot;

## Testcase and  Execution steps

```
var buffer = new Uint8Array([0,97,115,109,1,0,0,0,1,160,128,128,128,0,4,80,0,95,1,127,0,80,0,94,123,1,80,0,96,3,127,127,127,1,127,96,6,127,112,107,103,101,107,112,127,0,3,130,128,128,128,0,1,2,4,133,128,128,128,0,1,112,1,1,1,5,132,128,128,128,0,1,1,16,32,13,131,128,128,128,0,1,0,3,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,148,128,128,128,0,1,18,0,6,127,65,112,7,0,26,26,26,26,26,1,11,179,168,103,11]);
var module = new WebAssembly.Module(buffer);
var instance = new WebAssembly.Instance(module);
```
./bin/jsc  --useWebAssemblyGC=true --useWebAssemblyTypedFunctionReferences=true testcase.js

## Output
SHOULD NEVER BE REACHED
/home/WebKit/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp(1189) : JSC::Wasm::LLIntGenerator::PartialResult JSC::Wasm::LLIntGenerator::addCatchToUnreachable(unsigned int, const JSC::Wasm::TypeDefinition &amp;, JSC::Wasm::LLIntGenerator::ControlType &amp;, JSC::Wasm::LLIntGenerator::ResultList &amp;)

## Backtrace
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140735922812480) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140735922812480) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140735922812480) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140735922812480, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007fffed881476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007fffed8677f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff0c7a16f in WTFCrashWithInfo () at WTF/Headers/wtf/Assertions.h:762
#6  0x00007ffff4ea9003 in JSC::Wasm::LLIntGenerator::addCatchToUnreachable (this=this@entry=0x7fffa2af6ab0, exceptionIndex=exceptionIndex@entry=0, exceptionSignature=..., data=..., results=...)
    at /home/WebKit/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp:1189
#7  0x00007ffff4f14db0 in JSC::Wasm::LLIntGenerator::addCatch (this=0x7fffa2af6ab0, exceptionIndex=0, exceptionSignature=..., data=..., expressionStack=..., results=...)
    at /home/WebKit/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp:1155
#8  JSC::Wasm::FunctionParser&lt;JSC::Wasm::LLIntGenerator&gt;::parseExpression (this=this@entry=0x7fffa2af6c40) at /home/WebKit/Source/JavaScriptCore/wasm/WasmFunctionParser.h:2758
#9  0x00007ffff4eece8e in JSC::Wasm::FunctionParser&lt;JSC::Wasm::LLIntGenerator&gt;::parseBody (this=this@entry=0x7fffa2af6c40) at /home/WebKit/Source/JavaScriptCore/wasm/WasmFunctionParser.h:365
#10 0x00007ffff4ecd434 in JSC::Wasm::FunctionParser&lt;JSC::Wasm::LLIntGenerator&gt;::parse (this=this@entry=0x7fffa2af6c40) at /home/WebKit/Source/JavaScriptCore/wasm/WasmFunctionParser.h:336
#11 0x00007ffff4e85c3a in JSC::Wasm::parseAndCompileBytecode (functionStart=&lt;optimized out&gt;, functionLength=&lt;optimized out&gt;, signature=..., info=..., functionIndex=0)
    at /home/WebKit/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp:580
#12 0x00007ffff4ebf4ac in JSC::Wasm::LLIntPlan::compileFunction (this=0x615000017f00, functionIndex=0) at /home/WebKit/Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp:89
#13 0x00007ffff4e73891 in JSC::Wasm::EntryPlan::compileFunctions (this=0x615000017f00, effort=&lt;optimized out&gt;) at /home/WebKit/Source/JavaScriptCore/wasm/WasmEntryPlan.cpp:218
#14 0x00007ffff5101ad1 in JSC::Wasm::Worklist::Thread::work (this=0x607000004310) at /home/WebKit/Source/JavaScriptCore/wasm/WasmWorklist.cpp:111
#15 0x00007ffff55ddfa1 in WTF::AutomaticThread::start(WTF::AbstractLocker const&amp;)::$_0::operator()() const (this=&lt;optimized out&gt;) at /home/WebKit/Source/WTF/wtf/AutomaticThread.cpp:229
#16 WTF::Detail::CallableWrapper&lt;WTF::AutomaticThread::start(WTF::AbstractLocker const&amp;)::$_0, void&gt;::call() (this=&lt;optimized out&gt;) at /home/WebKit/Source/WTF/wtf/Function.h:53
#17 0x00007ffff56994c6 in WTF::Function&lt;void ()&gt;::operator()() const (this=&lt;optimized out&gt;) at /home/WebKit/Source/WTF/wtf/Function.h:82
#18 WTF::Thread::entryPoint (newThreadContext=&lt;optimized out&gt;) at /home/WebKit/Source/WTF/wtf/Threading.cpp:250
#19 0x00007ffff58377a6 in WTF::wtfThreadEntryPoint (context=0x3011bf) at /home/WebKit/Source/WTF/wtf/posix/ThreadingPOSIX.cpp:242
#20 0x00007fffed8d3b43 in start_thread (arg=&lt;optimized out&gt;) at ./nptl/pthread_create.c:442
#21 0x00007fffed965a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1965896</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-07-10 02:38:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/112006214&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2008671</commentid>
    <comment_count>2</comment_count>
    <who name="Asumu Takikawa">asumu</who>
    <bug_when>2024-01-29 14:58:53 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/23465</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2013553</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-02-14 10:38:05 -0800</bug_when>
    <thetext>Committed 274635@main (c76ab28ce98e): &lt;https://commits.webkit.org/274635@main&gt;

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

    </bug>

</bugzilla>