alexcrichton opened issue #14597:
This test:
#[wasmtime_test] fn test_trap_stack_overflow_mutual_recursion(config: &mut Config) -> Result<()> { let max_frames = NonZeroUsize::new(32).unwrap(); let wat = r#" (module $rec_mod (func $even (export "even") (call $odd)) (func $odd (call $even)) ) "#; config.wasm_backtrace_max_frames(Some(max_frames)); let engine = Engine::new(&config)?; let module = Module::new(&engine, wat)?; let mut store = Store::new(&engine, ()); let instance = Instance::new(&mut store, &module, &[])?; let even = instance.get_typed_func::<(), ()>(&mut store, "even")?; let e = even.call(&mut store, ()).unwrap_err(); // No frame may be skipped, so the frames must alternate between the two // functions. let trace = e.downcast_ref::<WasmBacktrace>().unwrap().frames(); assert_eq!(trace.len(), max_frames.get()); for pair in trace.windows(2) { assert_ne!(pair[0].func_index(), pair[1].func_index(), "{trace:?}"); } assert_eq!(e.downcast::<Trap>()?, Trap::StackOverflow); Ok(()) }passes on all platforms except s390x and Pulley. Neither of them handle stack overflow in such a way where the final frame on the stack is the frame that actually caused the stack overflow. This is a relatively minor issue, but it'd be nice to fix to help for attribution of stack overflows.
alexcrichton added the cranelift:area:s390x label to Issue #14597.
alexcrichton added the pulley label to Issue #14597.
alexcrichton added the bug label to Issue #14597.
Last updated: Oct 11 2026 at 04:10 UTC