Hi, is it possible to get exceptions stacktrace wh...
# webassembly
a
Hi, is it possible to get exceptions stacktrace when an error happens inside Kotlin 2.2.0-compiled Wasm (executed in NodeJS, old version of Exception Handling proposal)? The stacktrace seems be absent and debugging exceptions without a message like NPEs that happen somewhere is inconvenient to say the least. Not clear from the EH proposal if this is supported by the proposal itself but please advise if there are any debugging means that make it easier to localize the place where an exception is thrown other than using a bunch of `println`'s
i
Hi, is it for WasmJs or WasmWASI target?
a
It is WasmWASI, sorry, forget to mention it
i
It is not possible, because there is no way to get stack in WASI runtimes.
a
Thanks, is it a fundamental issue with the current exception handling proposal? Do you know by any chance if there is any proposal in the works that would make it possible in the future?
i
I think this is not covered by EHP because there is no good way to provide it without strings support. Anyway I do not know is there an any proposals for that. The only way to do that is to keep shadow stack but it will make a pressure to the memory, size and speed. So the only way to see now is to use the debugger.
thank you color 1
Maybe @bashor knows something about it.
a
Would have been great if there was an optional stacktrace collection that can be disabled for production builds if necessary. Frankly even on production it might make sense to compromise performance for being able to understand the error cause. I imagine it would be often near impossible to investigate any production issues especially in cases when input might contain some form of PII and can't be logged.
Is it possible to have source maps when debugging a module compiled with Wasm/WASI target running in NodeJS? https://kotlinlang.org/docs/wasm-debugging.html only talks about the wasmJs target
b
Right unfortunately it’s impossible to get stacktrace inside pure wasm and there is no active work around. We need more pressure in wasm community to get it fixed 🙂
a
Hey Zalim, so should I create a ticket then? Also would be nice to know how you measure the pressure 🙂
b
> Is it possible to have source maps when debugging a module compiled with Wasm/WASI target running in NodeJS? Yes, for dev build there should be a .map file along with a .wasm file
👀 1
Hey Zalim, so should I create a ticket then?
Yes, in Github WebAssembly org 🙂
👍 1
Also would be nice to know how you measure the pressure 🙂
I guess votes, mentions
when you create issue or discussion, please share link here in the thread or in the channel
a
Sure, will do