-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add origin information about Wasm traps #28
Comments
In general, there is no way to get location of the trap yet (although this should be very useful, and I think this is somwthing we want sooner rather than later) However, it is possible to print information provided in panic payload, at least if you have a custom panic fmt. But im not sure how panics are reported in wasm32-unknown-unknown with std. |
It looks like payload is ignored by rust compiler: https://github.com/rust-lang/rust/blob/master/src/libpanic_unwind/wasm32.rs#L28 Also, what do you mean by "print"? I don't think there is some builtin way to print something in wasm. |
AFAIK, actual printing happens in the panic hook, ie here which happens before
Yeah, you're right! However, in some envs such as web JS or wasmi we can define what it means to print something. And, In fact, wasm std lib supports basic i/o however under special flag Hope this helps! |
Wow, that worked like a charm! Thanks. Here is the code that catches panics and logs payload and location for anyone trying to figure it out. However, I think this issue (i.e. tracking traps and not only panics out of the box) depends on debugging symbols and should not be closed yet. Right? |
Im very happy thats worked! And yea, you right, we still need to have means to debug different kinds of traps and print stacktraces. And yeah it depends on debugging symbols (although plain name section should do the trick for the start) |
Closed in favor of #538. |
Hi,
Is there any way to debug where trap happened? At least function would be good, file+line and/or traceback is even better.
I'm using rust's wasm32-unknown-unknown for generating wasm code itself (and the trap is a panic). Maybe that's something to tweak at the compiler side?
The text was updated successfully, but these errors were encountered: