Stream: general

Topic: exception handling


view this post on Zulip Steve Williams (Oct 01 2021 at 11:34):

wasmtime status plz : functional or not ?

(don't personally need it right now - someone on another board asked)

view this post on Zulip bjorn3 (Oct 01 2021 at 19:22):

Do you mean wasm traps (work), the wasm exceptions proposal (no implementations anywhere AFAIK), panics from inside rust functions provided to the wasm code (work) or C++ exceptions when compiling to wasm (emscripten has a pass to turn them into mvp wasm code, so no engine support necessary in that case, emscripten doesn't work in wasmtime though) or something else?

view this post on Zulip Steve Williams (Oct 01 2021 at 19:27):

I mean this on mozilla web assembly group : https://matrix.to/#/!KoNjfbMUbtwPSBcKlx:mozilla.org/$eKZr2a4teGWVUC6qFFuVWuruuAzbYW-vDXrR0RtYGwc?via=mozilla.org&via=igalia.com&via=matrix.org

shouldn't get involved, not my current issue. but fyi. he asked if wasmtime supports exceptions & I don't know.

view this post on Zulip Steve Williams (Oct 01 2021 at 19:30):

unsure if that link is valid, https://chat.mozilla.org/#/room/#webassembly:mozilla.org

jmux posts, just above my lldbg stuff.

view this post on Zulip Chris Fallin (Oct 01 2021 at 19:45):

Replied over on Matrix; the answer is, unfortunately, that we don't support Wasm exception handling in Wasmtime yet

view this post on Zulip Chris Fallin (Oct 01 2021 at 19:45):

At some point we should but it's not being actively worked on by anyone (AFAIK)

view this post on Zulip fitzgen (he/him) (Oct 01 2021 at 19:53):

we do have exceptions support in wasmparser/wasm-encoder/wasm-smith/etc. fwiw so it is "just" a matter of implementing support in wasmtime (and cranelift)

view this post on Zulip Steve Williams (Oct 02 2021 at 09:00):

to complete my tangent, if he really must do something wasm with exceptions right now, emscripten is the way ?

view this post on Zulip Steve Williams (Oct 02 2021 at 09:04):

https://emscripten.org/

apparently not. its a toolchain, not a runtime.

view this post on Zulip Steve Williams (Oct 02 2021 at 09:06):

https://emscripten.org/docs/porting/exceptions.html

view this post on Zulip Jan-Marek Glogowski (Oct 02 2021 at 13:29):

For now I can use Emscripten's "JavaScript-based exception" handling. LibreOffice (LO) uses exceptions + threads. My build with -fwasm-exceptions failed, because the libpng + libjpeg based image decoders use setjmp + longjmp (patches tagged with SjLj in LLVM), which isn't supported by LLVM. Otherwise I have a LO demo app running in the browser (vcldemo), but that just tests the graphics backend. Still need to find a way to figure out dynamic function calls based on some mangled data, probably using call_indirect somehow. I've read somewhere, that WASM function tables + function typedef are dynamic, so eventually I can generate the entries on demand. On other platforms it uses assembler to prepare the needed registers with the systems call convention and eventual some trampoline code.

view this post on Zulip Chris Woods (Feb 08 2023 at 22:16):

It's been a long time since there was a conversation here. I'm pleased to report that we are working on adding Exception handling support to WAMR (not Wasmtime currently). There is a Github issue we are using to track this, you can find it here : https://github.com/bytecodealliance/wasm-micro-runtime/issues/1884

Please feel free to comment.

At the moment we've working through an implementation just for WAMR's interpreter, so not JIT / AOT support, at least initially.

We do have compatibility concerns, and would like to reach out to the browser teams to ensure that replicate whatever compliance that was completed between Spidermonkey and V8 to ensure exception handling worked between both teams, and of course to understand how the emscripten folk modified the clang++ tool chain to support WASM's exceptions..... some more learning to do, but we are making progress at the moment.

This issue has been created to track the implementation of exception handling support. This is based on the: Exception proposal. Exception WASM Specification. Current Status Exception handling is c...

view this post on Zulip bjorn3 (Feb 08 2023 at 23:12):

For the record I'm going to work on adding exception support to Cranelift for my bachlor thesis.

view this post on Zulip Scott Waye (Apr 25 2023 at 22:26):

Is there any non -browser runtime that support wasm exceptions yet?

view this post on Zulip Bailey Hayes (Apr 26 2023 at 00:38):

https://webassembly.org/roadmap/ only if you count wasm2c.

Wasmtime does not: https://github.com/bytecodealliance/wasmtime/blob/main/docs/stability-wasm-proposals-support.md
I scanned wamr and did not find mentions of the proposal there: https://github.com/bytecodealliance/wasm-micro-runtime/blob/a2d4744a2b2c587eacca66c357dc2e88925fcadd/RELEASE_NOTES.md

A fast and secure runtime for WebAssembly. Contribute to bytecodealliance/wasmtime development by creating an account on GitHub.
WebAssembly Micro Runtime (WAMR). Contribute to bytecodealliance/wasm-micro-runtime development by creating an account on GitHub.

view this post on Zulip Scott Waye (Apr 26 2023 at 00:50):

Thanks, I guess there is node/v8 depending if you count that as browser. Runs from the CLI so it is available where the other runtimes are generally at least.

view this post on Zulip bjorn3 (Apr 26 2023 at 06:43):

I'm currently working on adding exception support to Cranelift for my bachelor thesis.

view this post on Zulip Scott Waye (Apr 26 2023 at 12:13):

Awesome, good luck and look forward to seeing it

view this post on Zulip bjorn3 (Apr 26 2023 at 12:14):

Thanks!

view this post on Zulip bjorn3 (May 16 2023 at 13:24):

Status update: Got exception handling working with cg_clif. Currently working on implementing it for wasmtime.


Last updated: Dec 23 2024 at 12:05 UTC