Stream: git-wasmtime

Topic: wasmtime / issue #5339 Unable to Obtain Current Stack Tra...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2022 at 02:17):

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 are pub(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?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 29 2022 at 15:14):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 01 2022 at 22:19):

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 are pub(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?

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2022 at 17:34):

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?

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2022 at 19:20):

alexcrichton commented on issue #5339:

Ah sorry I forgot to update the PR title, the constructor is WasmBacktrace::capture now.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2022 at 20:55):

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`

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2022 at 21:26):

alexcrichton commented on issue #5339:

Are you using main or the release-4.0.0 branch? This feature isn't present in any crates.io-based release of Wasmtime yet.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2022 at 04:01):

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