hurae opened issue #6545:
Test Case
Simple hello world example, works fine with wasi preview1, but panic for component model.
// wit/see.wit package plugin:see world see { export run: func() -> result }
// seesee/src/lib.rs wit_bindgen::generate!({ path: "../wit/see.wit", world: "see", }); struct Checks; impl See for Checks { fn run() -> Result<(), ()> { println!("Hello, world!"); Ok(()) } } export_see!(Checks);
// part of Cargo.toml wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", default-features = false, features = [ "cranelift", "component-model", "async", ] } wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0"}
Steps to Reproduce
- new a rust project placed with above code
- run
cargo build --target wasm32-wasi --release
- run
wasm-tools component newseesee.wasm --adapt wasi_snapshot_preview1=component-type-version-3-f7ae056/wasi_snapshot_preview1.reactor.wasm -o seesee.component.wasm
to produce the component wasm file- run
call_run
func with api provided by wasmtime crate.The last step is just a copy of
src/commands/run.rs
which replaced all related things to component version.Expected Results
Print the string to
stdout
.Actual Results
└─> ❯ cargo run ../rskyeye/seesee/seesee.component.wasm Finished dev [unoptimized + debuginfo] target(s) in 0.18s Running `target/debug/runner ../rskyeye/seesee/seesee.component.wasm` Error: error while executing at wasm backtrace: 0: 0x9792 - <unknown>!rust_panic 1: 0x9780 - <unknown>!std::panicking::rust_panic_with_hook::h1c67ce6bc4eb31b7 2: 0x8728 - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h749586aa4ef76f6f 3: 0x865e - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h426b71926848cb31 4: 0x8eae - <unknown>!rust_begin_unwind 5: 0x231a - <unknown>!core::panicking::panic_fmt::hf4ce15c1b219b988 6: 0x7c20 - <unknown>!std::io::stdio::_print::hc2f2653d6b9a5348 7: 0x578a - <unknown>!run Caused by: wasm trap: wasm `unreachable` instruction executed
Versions and Environment
Wasmtime version or commit:
Tried both branch "release-10.0.0" and commit "92024ad11728efa9b3b59b426ebc7cc817cebf6b" which is the last component type version 2 version.
component adapter:
Tried both commit
92024ad
(component type version 2, with wasm-tools 1.0.34) andf7ae056
(component type version 3, with wasm-tools 1.0.35) with exactly the same commit ofwasmtime
andwasmtime_wasi
.Operating system:
Linux fedora 6.2.14-300.fc38.x86_64
Architecture: AMD64
Extra Info
The same wasm file works before composing to component with adapter when run following command on all of version
8.0.0
,9.0.0
,9.0.3
and commit92024ad11728efa9b3b59b426ebc7cc817cebf6b
:wasmtime run seesee.wasi.wasm --invoke run
hurae labeled issue #6545:
Test Case
Simple hello world example, works fine with wasi preview1, but panic for component model.
// wit/see.wit package plugin:see world see { export run: func() -> result }
// seesee/src/lib.rs wit_bindgen::generate!({ path: "../wit/see.wit", world: "see", }); struct Checks; impl See for Checks { fn run() -> Result<(), ()> { println!("Hello, world!"); Ok(()) } } export_see!(Checks);
// part of Cargo.toml wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", default-features = false, features = [ "cranelift", "component-model", "async", ] } wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0"}
Steps to Reproduce
- new a rust project placed with above code
- run
cargo build --target wasm32-wasi --release
- run
wasm-tools component newseesee.wasm --adapt wasi_snapshot_preview1=component-type-version-3-f7ae056/wasi_snapshot_preview1.reactor.wasm -o seesee.component.wasm
to produce the component wasm file- run
call_run
func with api provided by wasmtime crate.The last step is just a copy of
src/commands/run.rs
which replaced all related things to component version.Expected Results
Print the string to
stdout
.Actual Results
└─> ❯ cargo run ../rskyeye/seesee/seesee.component.wasm Finished dev [unoptimized + debuginfo] target(s) in 0.18s Running `target/debug/runner ../rskyeye/seesee/seesee.component.wasm` Error: error while executing at wasm backtrace: 0: 0x9792 - <unknown>!rust_panic 1: 0x9780 - <unknown>!std::panicking::rust_panic_with_hook::h1c67ce6bc4eb31b7 2: 0x8728 - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h749586aa4ef76f6f 3: 0x865e - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h426b71926848cb31 4: 0x8eae - <unknown>!rust_begin_unwind 5: 0x231a - <unknown>!core::panicking::panic_fmt::hf4ce15c1b219b988 6: 0x7c20 - <unknown>!std::io::stdio::_print::hc2f2653d6b9a5348 7: 0x578a - <unknown>!run Caused by: wasm trap: wasm `unreachable` instruction executed
Versions and Environment
Wasmtime version or commit:
Tried both branch "release-10.0.0" and commit "92024ad11728efa9b3b59b426ebc7cc817cebf6b" which is the last component type version 2 version.
component adapter:
Tried both commit
92024ad
(component type version 2, with wasm-tools 1.0.34) andf7ae056
(component type version 3, with wasm-tools 1.0.35) with exactly the same commit ofwasmtime
andwasmtime_wasi
.Operating system:
Linux fedora 6.2.14-300.fc38.x86_64
Architecture: AMD64
Extra Info
The same wasm file works before composing to component with adapter when run following command on all of version
8.0.0
,9.0.0
,9.0.3
and commit92024ad11728efa9b3b59b426ebc7cc817cebf6b
:wasmtime run seesee.wasi.wasm --invoke run
hurae edited issue #6545:
Test Case
Simple hello world example, works fine with wasi preview1, but panic for component model.
// wit/see.wit package plugin:see world see { export run: func() -> result }
// seesee/src/lib.rs wit_bindgen::generate!({ path: "../wit/see.wit", world: "see", }); struct Checks; impl See for Checks { fn run() -> Result<(), ()> { println!("Hello, world!"); Ok(()) } } export_see!(Checks);
// part of Cargo.toml wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", default-features = false, features = [ "cranelift", "component-model", "async", ] } wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0"}
Steps to Reproduce
- new a rust project placed with above code
- run
cargo build --target wasm32-wasi --release
- run
wasm-tools component newseesee.wasm --adapt wasi_snapshot_preview1=component-type-version-3-f7ae056/wasi_snapshot_preview1.reactor.wasm -o seesee.component.wasm
to produce the component wasm file- run
call_run
func with api provided by wasmtime crate.The last step is just a copy of
src/commands/run.rs
which replaced all related things to component version.Expected Results
Print the string to
stdout
.Actual Results
└─> ❯ cargo run ../rskyeye/seesee/seesee.component.wasm Finished dev [unoptimized + debuginfo] target(s) in 0.18s Running `target/debug/runner ../rskyeye/seesee/seesee.component.wasm` Error: error while executing at wasm backtrace: 0: 0x9792 - <unknown>!rust_panic 1: 0x9780 - <unknown>!std::panicking::rust_panic_with_hook::h1c67ce6bc4eb31b7 2: 0x8728 - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h749586aa4ef76f6f 3: 0x865e - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h426b71926848cb31 4: 0x8eae - <unknown>!rust_begin_unwind 5: 0x231a - <unknown>!core::panicking::panic_fmt::hf4ce15c1b219b988 6: 0x7c20 - <unknown>!std::io::stdio::_print::hc2f2653d6b9a5348 7: 0x578a - <unknown>!run Caused by: wasm trap: wasm `unreachable` instruction executed
Versions and Environment
Wasmtime version or commit:
Tried both branch "release-10.0.0" and commit "92024ad11728efa9b3b59b426ebc7cc817cebf6b" which is the last component type version 2 version.
component adapter:
Tried both commit
92024ad
(component type version 2, with wasm-tools 1.0.34) andf7ae056
(component type version 3, with wasm-tools 1.0.35) with exactly the same commit ofwasmtime
andwasmtime_wasi
.Operating system:
Linux fedora 6.2.14-300.fc38.x86_64
Architecture: AMD64
Extra Info
The same wasm file works before composing to component with adapter when run following command on all of version
8.0.0
,9.0.0
,9.0.3
and commit92024ad11728efa9b3b59b426ebc7cc817cebf6b
:wasmtime run seesee.wasi.wasm --invoke run
pchickey commented on issue #6545:
Log would be helpful here as well
hurae commented on issue #6545:
wasmtime_wasi
didn't produce any log. Here is the best result I can get:set this:
RUST_LOG=trace,cranelift_codegen=info,wasmtime_cranelift::compiler=info,cranelift_wasm::func_translator=info
[2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] creating instance InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] creating instance InstanceId(1) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] creating instance InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(1) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(1) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] creating instance InstanceId(3) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(1) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(1) [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section .wasmtime.engine [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section .symtab [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section .strtab [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section .shstrtab [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] ====== Capturing Backtrace ====== [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] === Tracing through contiguous sequence of Wasm frames === [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] trampoline_sp = 0x00007f24f3205220 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] initial pc = 0x00007f24f321d9e4 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] initial fp = 0x00007f24f32050e0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321d9e4 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f32050e0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321d01b [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f3205150 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321b56c [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f3205180 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321b3ff [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f3205190 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321c664 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f32051a0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f320a453 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f32051b0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f320ab80 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f32051d0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f3212908 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f3205210 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] === Done tracing contiguous sequence of Wasm frames === [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] ====== Done Capturing Backtrace (reached end of activations) ====== Error: error while executing at wasm backtrace: 0: 0xb237 - <unknown>!rust_panic 1: 0xb225 - <unknown>!std::panicking::rust_panic_with_hook::h1c67ce6bc4eb31b7 2: 0xa1cd - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h749586aa4ef76f6f 3: 0xa103 - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h426b71926848cb31 4: 0xa953 - <unknown>!rust_begin_unwind 5: 0x236d - <unknown>!core::panicking::panic_fmt::hf4ce15c1b219b988 6: 0x27ed - <unknown>!core::result::unwrap_failed::he6bfae7ea6f8795e 7: 0x6281 - <unknown>!run Caused by: wasm trap: wasm `unreachable` instruction executed
hurae edited a comment on issue #6545:
Reproduced in branch "release-10.0.0".
wasmtime_wasi
didn't produce any log. Here is the best result I can get:set this:
RUST_LOG=trace,cranelift_codegen=info,wasmtime_cranelift::compiler=info,cranelift_wasm::func_translator=info
[2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] creating instance InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] creating instance InstanceId(1) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] creating instance InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(1) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(1) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] creating instance InstanceId(3) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(1) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(2) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(0) [2023-06-12T03:04:46Z TRACE wasmtime_environ::component::dfg] referencing export of InstanceId(1) [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section .wasmtime.engine [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section .symtab [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section .strtab [2023-06-12T03:04:48Z DEBUG wasmtime_jit::code_memory] ignoring section .shstrtab [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] ====== Capturing Backtrace ====== [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] === Tracing through contiguous sequence of Wasm frames === [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] trampoline_sp = 0x00007f24f3205220 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] initial pc = 0x00007f24f321d9e4 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] initial fp = 0x00007f24f32050e0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321d9e4 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f32050e0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321d01b [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f3205150 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321b56c [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f3205180 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321b3ff [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f3205190 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f321c664 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f32051a0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f320a453 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f32051b0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f320ab80 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f32051d0 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] --- Tracing through one Wasm frame --- [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] pc = 0x7f24f3212908 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] fp = 0x7f24f3205210 [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] === Done tracing contiguous sequence of Wasm frames === [2023-06-12T03:04:48Z TRACE wasmtime_runtime::traphandlers::backtrace] ====== Done Capturing Backtrace (reached end of activations) ====== Error: error while executing at wasm backtrace: 0: 0xb237 - <unknown>!rust_panic 1: 0xb225 - <unknown>!std::panicking::rust_panic_with_hook::h1c67ce6bc4eb31b7 2: 0xa1cd - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h749586aa4ef76f6f 3: 0xa103 - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h426b71926848cb31 4: 0xa953 - <unknown>!rust_begin_unwind 5: 0x236d - <unknown>!core::panicking::panic_fmt::hf4ce15c1b219b988 6: 0x27ed - <unknown>!core::result::unwrap_failed::he6bfae7ea6f8795e 7: 0x6281 - <unknown>!run Caused by: wasm trap: wasm `unreachable` instruction executed
hurae commented on issue #6545:
Fixed by https://github.com/bytecodealliance/wasmtime/issues/6546 , same reason.
hurae closed issue #6545:
Test Case
Simple hello world example, works fine with wasi preview1, but panic for component model.
// wit/see.wit package plugin:see world see { export run: func() -> result }
// seesee/src/lib.rs wit_bindgen::generate!({ path: "../wit/see.wit", world: "see", }); struct Checks; impl See for Checks { fn run() -> Result<(), ()> { println!("Hello, world!"); Ok(()) } } export_see!(Checks);
// part of Cargo.toml wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", default-features = false, features = [ "cranelift", "component-model", "async", ] } wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0"}
Steps to Reproduce
- new a rust project placed with above code
- run
cargo build --target wasm32-wasi --release
- run
wasm-tools component newseesee.wasm --adapt wasi_snapshot_preview1=component-type-version-3-f7ae056/wasi_snapshot_preview1.reactor.wasm -o seesee.component.wasm
to produce the component wasm file- run
call_run
func with api provided by wasmtime crate.The last step is just a copy of
src/commands/run.rs
which replaced all related things to component version.Expected Results
Print the string to
stdout
.Actual Results
└─> ❯ cargo run ../rskyeye/seesee/seesee.component.wasm Finished dev [unoptimized + debuginfo] target(s) in 0.18s Running `target/debug/runner ../rskyeye/seesee/seesee.component.wasm` Error: error while executing at wasm backtrace: 0: 0x9792 - <unknown>!rust_panic 1: 0x9780 - <unknown>!std::panicking::rust_panic_with_hook::h1c67ce6bc4eb31b7 2: 0x8728 - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h749586aa4ef76f6f 3: 0x865e - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h426b71926848cb31 4: 0x8eae - <unknown>!rust_begin_unwind 5: 0x231a - <unknown>!core::panicking::panic_fmt::hf4ce15c1b219b988 6: 0x7c20 - <unknown>!std::io::stdio::_print::hc2f2653d6b9a5348 7: 0x578a - <unknown>!run Caused by: wasm trap: wasm `unreachable` instruction executed
Versions and Environment
Wasmtime version or commit:
Tried both branch "release-10.0.0" and commit "92024ad11728efa9b3b59b426ebc7cc817cebf6b" which is the last component type version 2 version.
component adapter:
Tried both commit
92024ad
(component type version 2, with wasm-tools 1.0.34) andf7ae056
(component type version 3, with wasm-tools 1.0.35) with exactly the same commit ofwasmtime
andwasmtime_wasi
.Operating system:
Linux fedora 6.2.14-300.fc38.x86_64
Architecture: AMD64
Extra Info
The same wasm file works before composing to component with adapter when run following command on all of version
8.0.0
,9.0.0
,9.0.3
and commit92024ad11728efa9b3b59b426ebc7cc817cebf6b
:wasmtime run seesee.wasi.wasm --invoke run
Last updated: Dec 23 2024 at 12:05 UTC