vouillon added the bug label to Issue #10182.
vouillon opened issue #10182:
Test Case
Steps to Reproduce
Run the following command:
./target/debug/wasmtime -W=all-proposals=y localfunction.wasm
Expected Results
This works fine if one add the
-C collector=null
option:$ ./target/debug/wasmtime -C collector=null -W=all-proposals=y localfunction.wasm 5840
Actual Results
We get a panic:
thread 'main' panicked at crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs:142:9: assertion `left != right` failed: 0x110 is supposedly live; should have nonzero ref count left: 0 right: 0 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread 'main' panicked at crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs:167:9: assertion `left != right` failed: 0x110 is supposedly live; should have nonzero ref count left: 0 right: 0 stack backtrace: 0: 0x5a63fb6a476a - std::backtrace_rs::backtrace::libunwind::trace::h5a5b8284f2d0c266 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5 1: 0x5a63fb6a476a - std::backtrace_rs::backtrace::trace_unsynchronized::h76d4f1c9b0b875e3 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x5a63fb6a476a - std::sys::backtrace::_print_fmt::hc4546b8364a537c6 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/sys/backtrace.rs:66:9 3: 0x5a63fb6a476a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h5b6bd5631a6d1f6b at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/sys/backtrace.rs:39:26 4: 0x5a63fb6ce503 - core::fmt::rt::Argument::fmt::h270f6602a2b96f62 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/fmt/rt.rs:177:76 5: 0x5a63fb6ce503 - core::fmt::write::h7550c97b06c86515 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/fmt/mod.rs:1186:21 6: 0x5a63fb69ffc3 - std::io::Write::write_fmt::h7b09c64fe0be9c84 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/io/mod.rs:1839:15 7: 0x5a63fb6a45b2 - std::sys::backtrace::BacktraceLock::print::h2395ccd2c84ba3aa at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/sys/backtrace.rs:42:9 8: 0x5a63fb6a569c - std::panicking::default_hook::{{closure}}::he19d4c7230e07961 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:268:22 9: 0x5a63fb6a54e2 - std::panicking::default_hook::hf614597d3c67bbdb at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:295:9 10: 0x5a63fb6a5c77 - std::panicking::rust_panic_with_hook::h8942133a8b252070 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:801:13 11: 0x5a63fb6a5b0a - std::panicking::begin_panic_handler::{{closure}}::hb5f5963570096b29 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:674:13 12: 0x5a63fb6a4c49 - std::sys::backtrace::__rust_end_short_backtrace::h6208cedc1922feda at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/sys/backtrace.rs:170:18 13: 0x5a63fb6a579c - rust_begin_unwind at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:665:5 14: 0x5a63f7799390 - core::panicking::panic_fmt::h0c3082644d1bf418 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/panicking.rs:74:14 15: 0x5a63f77997f5 - core::panicking::assert_failed_inner::h2ddf1fcc067fa858 16: 0x5a63f77989e3 - core::panicking::assert_failed::he996b0f85b093fc8 17: 0x5a63f9a20bab - wasmtime::runtime::vm::gc::enabled::drc::DrcHeap::dec_ref::hedee28eb8908882f at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs:167:9 18: 0x5a63f9a21054 - wasmtime::runtime::vm::gc::enabled::drc::DrcHeap::dec_ref_and_maybe_dealloc::h1e7fa8dbf0f76afe at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs:191:12 19: 0x5a63f9a22844 - <wasmtime::runtime::vm::gc::enabled::drc::DrcHeap as wasmtime::runtime::vm::gc::gc_runtime::GcHeap>::write_gc_ref::h907c2f5b9fd965de at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs:503:13 20: 0x5a63f9aa19cf - wasmtime::runtime::vm::gc::gc_runtime::GcHeap::drop_gc_ref::h3fd8951c49276ad4 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/gc/gc_runtime.rs:135:9 21: 0x5a63f9af0025 - wasmtime::runtime::vm::gc::GcStore::drop_gc_ref::h83ca711fdd26510d at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/gc.rs:132:13 22: 0x5a63f98183c5 - wasmtime::runtime::gc::enabled::rooting::RootSet::exit_lifo_scope_slow::hc31f21972eab0174 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/gc/enabled/rooting.rs:443:17 23: 0x5a63f9818135 - wasmtime::runtime::gc::enabled::rooting::RootSet::exit_lifo_scope::hb268344dded0d6a3 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/gc/enabled/rooting.rs:422:13 24: 0x5a63f97cee70 - wasmtime::runtime::store::StoreOpaque::exit_gc_lifo_scope::h44bd36e830734cde at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/store.rs:1492:9 25: 0x5a63f9a6d725 - <wasmtime::runtime::gc::enabled::rooting::OpaqueRootScope<S> as core::ops::drop::Drop>::drop::ha14dd9b0aeec651d at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/gc/enabled/rooting.rs:1247:9 26: 0x5a63f9a4df0b - core::ptr::drop_in_place<wasmtime::runtime::gc::enabled::rooting::OpaqueRootScope<&mut wasmtime::runtime::store::StoreOpaque>>::h59a509a3e5e5c5f8 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/ptr/mod.rs:574:1 27: 0x5a63f9b49968 - wasmtime::runtime::vm::libcalls::array_copy::h31ca675977d4cf37 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/libcalls.rs:1000:1 28: 0x5a63f97d10f8 - wasmtime::runtime::vm::libcalls::raw::array_copy::{{closure}}::{{closure}}::he609ade1bf0fe50d at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/libcalls.rs:122:33 29: 0x5a63f98d1d1f - wasmtime::runtime::vm::instance::InstanceAndStore::from_vmctx::h70b7552243828ec3 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/instance.rs:124:9 30: 0x5a63f97d1082 - wasmtime::runtime::vm::libcalls::raw::array_copy::{{closure}}::h069e468a9f8d43bc at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/libcalls.rs:120:29 31: 0x5a63f9b186d9 - <core::result::Result<T,E> as wasmtime::runtime::vm::traphandlers::HostResult>::maybe_catch_unwind::{{closure}}::h7870e327860e3570 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/traphandlers.rs:213:31 32: 0x5a63f973efcd - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h97e8c5250be12328 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/panic/unwind_safe.rs:272:9 33: 0x5a63f9b2dd1d - std::panicking::try::do_call::h6ddcfddda81ba7e9 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:557:40 34: 0x5a63f984e37b - __rust_try 35: 0x5a63f984d449 - std::panicking::try::h359f8a567d0cf151 at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:520:19 36: 0x5a63f984d449 - std::panic::catch_unwind::haf37da711ec3695b at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panic.rs:358:14 37: 0x5a63f99db9a4 - <core::result::Result<T,E> as wasmtime::runtime::vm::traphandlers::HostResult>::maybe_catch_unwind::h70a996b0428a25ac at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/traphandlers.rs:222:19 38: 0x5a63f9b0ef3d - wasmtime::runtime::vm::traphandlers::catch_unwind_and_record_trap::h153a9f7f708e7bb2 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/traphandlers.rs:117:25 39: 0x5a63f97baa09 - wasmtime::runtime::vm::libcalls::raw::array_copy::hcd61143763fafd13 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/libcalls.rs:119:25 40: 0x706e77362029 - <unknown> 41: 0x706e77319a4f - <unknown> 42: 0x706e77326c4a - <unknown> 43: 0x706e77319ea1 - <unknown> 44: 0x706e77313381 - <unknown> 45: 0x706e773127db - <unknown> 46: 0x706e7735d437 - <unknown> 47: 0x5a63f977f3b6 - wasmtime::runtime::vm::vmcontext::VMFuncRef::array_call_native::hdea3785bb4610271 at /home/jerome/sources/wasmtime/crates/wasmtime/src/runtime/vm/vmcontext.rs:792:9 48: 0x5a63f977f1f2 - wasmtime::runtime::vm::vmcontext::VMFuncRef::array_call::ha55c8ae49afd506e [message truncated]
alexcrichton assigned fitzgen to issue #10182.
fitzgen added the wasm-proposal:gc label to Issue #10182.
fitzgen commented on issue #10182:
Thanks for this bug report as well!
Ditto regarding reducing the test case, if you have time.
vouillon commented on issue #10182:
This seems to have something to do with
array.copy
:(module (type $0 (array (mut (ref eq)))) (type $1 (func)) (global $global$0 (ref $0) (array.new_fixed $0 1 (array.new_fixed $0 0) )) (export "" (func $0)) (func $0 (local $0 (ref $0)) (local.set $0 (global.get $global$0) ) (array.copy $0 $0 (local.get $0) (i32.const 0) (local.get $0) (i32.const 0) (i32.const 1) ) ) )
Last updated: Feb 28 2025 at 02:27 UTC