Stream: git-wasmtime

Topic: wasmtime / issue #674 [lightbeam] panic due to unreachabl...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 27 2021 at 17:29):

alexcrichton commented on issue #674:

Lightbeam was removed in https://github.com/bytecodealliance/wasmtime/pull/3390 as explained in RFC 14, so I'm going to close this.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 27 2021 at 17:29):

alexcrichton closed issue #674:

Issue description

wasmtime with lightbeam backend panic due to an unreachable!. This issue will make program calling lightbeam as 3rd party library to crash. Instead an error should be through to let the caller handle it properly.

Reproduction

wasmtime commit: 3558d41cea889b4c91a8d2c40a87746fdfcd5e01

Compilation with debug info:

$ RUSTFLAGS=-g cargo build --release --features lightbeam

Download & run testcase:
panic_internal_unreachable_code.zip

$ unzip panic_internal_unreachable_code.zip
$ ./target/release/wasmtime --lightbeam panic_internal_unreachable_code.wasm
thread 'main' panicked at 'internal error: entered unreachable code', crates/lightbeam/src/backend.rs:3559:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Related piece of code

lightbeam panics because of a calling to unreachable! macro.

https://github.com/bytecodealliance/wasmtime/blob/3558d41cea889b4c91a8d2c40a87746fdfcd5e01/crates/lightbeam/src/backend.rs#L3558-L3560

Fix proposal

After applying the pull request 672, wasmtime will return:

$ ./target/release/wasmtime --lightbeam panic_internal_unreachable_code.wasm
Error: failed to process main module `panic_internal_unreachable_code.wasm`

Caused by:
    0: WebAssembly failed to compile
    1: Compilation error: Failed to translate function: Microwasm error: i32_extend_s unreachable code
~~~


Last updated: Oct 23 2024 at 20:03 UTC