Bug 242077

Summary: The catchability of WASM stack overflow exceptions should match the spec
Product: WebKit Reporter: Justin Michaud <justin_michaud>
Component: WebAssemblyAssignee: Justin Michaud <justin_michaud>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: keith_miller, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Justin Michaud 2022-06-28 12:10:59 PDT
We currently allow stack overflow exceptions from within wasm code to be caught by a catch_all block, which does not match v8.

Wasm stack overflows are specified to be the same type as JS stack overflows:

https://webassembly.github.io/exception-handling/js-api/index.html#js-exceptions

The proposal says that these are not catchable:

https://github.com/WebAssembly/exception-handling/issues/202

But I cannot find that this is specified in the formal spec:

https://webassembly.github.io/exception-handling/js-api/index.html#errors

We are probably doing the wrong thing here, but maybe we should file a spec bug too.
Comment 1 Radar WebKit Bug Importer 2022-07-05 12:11:15 PDT
<rdar://problem/96459590>
Comment 2 Keith Miller 2024-03-26 08:51:07 PDT
As far as I can tell from https://github.com/WebAssembly/exception-handling/issues/202 it seems like we're doing the right thing already. "#218 (comment) basically says, if JS throws an exception and it passes through Wasm (either by not being caught or being caught and rethrown) the exception object you will get is the same as the one you threw." Seems to imply that JS exceptions should be catchall-able.
Comment 3 Justin Michaud 2024-04-08 13:37:18 PDT
Closing old bugs assigned to me