Bug 255461

Summary: jitCompileSIMDFunction crash during webapp load
Product: WebKit Reporter: sblochwehbas
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: justin_michaud, mark.lam, michael.hagar, simon.fraser, tommy.li, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
Attachments:
Description Flags
Crash Report from Console.app.
none
Console crash report when using WebAssembly.compile on WASM SIMD
none
Crash Log of build 274235@main
none
Translated Crash Report of build 274235@main none

Description sblochwehbas 2023-04-14 10:04:52 PDT
Created attachment 465917 [details]
Crash Report from Console.app.

Safari 16.4 18615.1.26.11.23
MacOS 13.3.1
Apple M1 Max
64 GB RAM

Crashing quite frequently on our web app during initial load/startup.
Comment 1 Radar WebKit Bug Importer 2023-04-14 10:12:28 PDT
<rdar://problem/108054708>
Comment 2 Michael Hagar 2023-11-28 13:56:48 PST
Created attachment 468791 [details]
Console crash report when using WebAssembly.compile on WASM SIMD

I'm seeing a similar crash when trying to use WebAssembly.compile or WebAssembly.compileStreaming on a certain WebAssembly file that uses SIMD instructions on the main thread, then passing the compiled WebAssembly module toa worker thread, and the instantiating said module.

Not using SIMD doesn't lead to a crash, and using instantiate / instantiateStreaming doesn't lead to a crash either. So it seems to be related to a combination of using SIMD and using WebAssembly.compile / WebAssembly.compileStreaming.

I attached the crash report found in the Console app.
Comment 3 Tommy Li 2024-02-07 14:18:03 PST
Created attachment 469762 [details]
Crash Log of build 274235@main
Comment 4 Tommy Li 2024-02-07 14:24:22 PST
I have also been seeing similar issues since Safari 16.4, till the latest 17.3. The latest development build 274235@main also crashes with our SIMD-enabled WebAssembly file. 

Our WebAssembly file is compiled from a C++ codebase with the Emscripten toolchain (Version 3.1.53, the latest as of writing). 

To concur with Michael, in our development, some of our WebAssembly files compiled with SIMD enabled do not actually crash Safari, only a certain other file does when extra C++ code are include. We have yet to closely examine what code is causing the crash.
Comment 5 Tommy Li 2024-02-07 14:26:27 PST
Created attachment 469763 [details]
Translated Crash Report of build 274235@main

Attached is the translated report of the crash for your information.