leoyvens opened PR #2309 from trap-is-user
to main
:
The public
Trap
in wasmtime is right now very opaque compared to the internal information which is available about the trap reason. This exposes the trap code of a wasm trap, which is useful to for example differentiate traps from host functions to traps coming from wasm itself.
leoyvens updated PR #2309 from trap-is-user
to main
:
The public
Trap
in wasmtime is right now very opaque compared to the internal information which is available about the trap reason. This exposes the trap code of a wasm trap, which is useful to for example differentiate traps from host functions to traps coming from wasm itself.
leoyvens updated PR #2309 from trap-is-user
to main
:
The public
Trap
in wasmtime is right now very opaque compared to the internal information which is available about the trap reason. This exposes the trap code of a wasm trap, which is useful to for example differentiate traps from host functions to traps coming from wasm itself.
alexcrichton submitted PR Review.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
I think this documentation may need an update since I think it's cranelift-specific. Also can you add a test that traps are reported as
HeapOutOfBounds
? The extra clause here is a little worrisome...
alexcrichton created PR Review Comment:
This I presume is copy-pasted, but mind dropping this clause? I believe this is no longer the case.
alexcrichton created PR Review Comment:
I'm not sure if this can actually arise from wasm code? We may not need to include this?
alexcrichton created PR Review Comment:
I think the
table_addr
bit here needs to be tweaked in the documentation since that's cranelift-internal.
alexcrichton created PR Review Comment:
The "resumable" part here can be dropped since that's not true of wasmtime right now.
alexcrichton created PR Review Comment:
Could this be expanded a bit to explain when it's
None
and when it'sSome
?
leoyvens updated PR #2309 from trap-is-user
to main
:
The public
Trap
in wasmtime is right now very opaque compared to the internal information which is available about the trap reason. This exposes the trap code of a wasm trap, which is useful to for example differentiate traps from host functions to traps coming from wasm itself.
leoyvens submitted PR Review.
leoyvens created PR Review Comment:
This does happen for non-saturating truncation and this specific case of division https://github.com/WebAssembly/spec/blob/55a5e2c88890ccbe2b992f571b95704234977dac/interpreter/exec/int.ml#L131. Maybe there is a better name for this variant.
leoyvens edited PR Review Comment.
leoyvens submitted PR Review.
leoyvens created PR Review Comment:
Added tests, whatever that clause means I couldn't find any consequences of it in testing so I removed it here.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
Ah yes, indeed!
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
Could this get moved to
tests/all/*.rs
? That's were we store most other tests.
alexcrichton submitted PR Review.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
Also, while you're at it, mind simplifying this a bit with a helper function?
fn assert_trap_code(wat: &str, code: ir::TrapCode)
or something like that?
leoyvens updated PR #2309 from trap-is-user
to main
:
The public
Trap
in wasmtime is right now very opaque compared to the internal information which is available about the trap reason. This exposes the trap code of a wasm trap, which is useful to for example differentiate traps from host functions to traps coming from wasm itself.
alexcrichton merged PR #2309.
Last updated: Dec 23 2024 at 12:05 UTC