Closed
Description
Issue description
A call to assert!
make wasmtime
to panic (on both backends) when the memory is shared.
$ ./target/release/wasmtime assert_mt_failed.wasm
thread 'main' panicked at 'assertion failed: !mt.shared', crates/api/src/module.rs:14:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
$ ./target/release/wasmtime --lightbeam assert_mt_failed.wasm
thread 'main' panicked at 'assertion failed: !mt.shared', crates/api/src/module.rs:14:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
This issue is related to the following piece of code:
wasmtime/crates/api/src/module.rs
Lines 13 to 16 in 31472fb
Reproduction
Download assert_mt_failed.zip
or wasm2wat --enable-all assert_mt_failed.wasm
:
(module
(type (;0;) (func))
(type (;1;) (func (result i32)))
(func (;0;) (type 0)
i32.const 0
memory.grow
i32.load8_u
i64.load8_s offset=119
memory.size
unreachable)
(func (;1;) (type 0)
i32.const 0
nop
call 0
unreachable)
(func (;2;) (type 0)
call 0
call 0
call 0)
(memory (;0;) 1 1 shared)
(export "w1c" (func 0))
(export "get" (func 1))
(start 2)
(data (;0;) (i32.const 0) "A"))
Note: this testcase can be even more minimized.
Build wasmtime with lightbeam:
$ RUSTFLAGS=-g cargo build --release --features lightbeam
wasmtime commit: 31472fb