jtenner opened issue #5339:
Hey! I am trying to obtain the current stack trace without invoking a panic, inside a linked function.
// this is awesome! let backtrace = Backtrace::new();
I can access the stack frames using
Backtrace::new()
but I can't really do anything with it because all the functions that translate these into function names and strings arepub(crate)
and internal to wasmtime.Is there perhaps a safe way to obtain the current stack trace without calling a wasm function that executes an unreachable() instruction?
alexcrichton commented on issue #5339:
While not currently possible now I opened https://github.com/bytecodealliance/wasmtime/pull/5341 to expose a method for doing this.
alexcrichton closed issue #5339:
Hey! I am trying to obtain the current stack trace without invoking a panic, inside a linked function.
// this is awesome! let backtrace = Backtrace::new();
I can access the stack frames using
Backtrace::new()
but I can't really do anything with it because all the functions that translate these into function names and strings arepub(crate)
and internal to wasmtime.Is there perhaps a safe way to obtain the current stack trace without calling a wasm function that executes an unreachable() instruction?
jtenner commented on issue #5339:
@alexcrichton it looks like the
WasmBacktrace::new()
function is private and not exposed. Can I get some help with this?
alexcrichton commented on issue #5339:
Ah sorry I forgot to update the PR title, the constructor is
WasmBacktrace::capture
now.
jtenner commented on issue #5339:
error[E0599]: no function or associated item named `capture` found for struct `WasmBacktrace` in the current scope --> crates\lunatic-process-api\src\lib.rs:805:36 | 805 | let backtrace = WasmBacktrace::capture(); | ^^^^^^^ function or associated item not found in `WasmBacktrace`
alexcrichton commented on issue #5339:
Are you using
main
or therelease-4.0.0
branch? This feature isn't present in any crates.io-based release of Wasmtime yet.
jtenner commented on issue #5339:
@alexcrichton I'm downstream using lunatic on version 3.0.1 so that explains why the feature wasn't present. My mistake.
Last updated: Nov 22 2024 at 16:03 UTC