-
Notifications
You must be signed in to change notification settings - Fork 203
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
[NativeAOT-LLVM] Implement managed stack traces #2404
Comments
Maybe relevant: WebAssembly/wasi-sdk#334 (comment) |
#2677 implements the initial version for browser, with the following NYIs:
Cleanup: fix llvm/llvm-project#100733 and define |
The WASI part of this work was fully (no known NYIs) implemented in #2697. |
Note: below status is no longer current, I am keeping it for now as a historical retrospective. See #2404 (comment) for the work that remains.
This is a large work item so I am splitting it from #2169.
What we have today:
The mangled names have so far been an acceptable stop-gap solution, but we can and should do better. The ultimate goal is parity with the implementation on non-WASM targets.
Here's a rough outline of the strategy that would work for the browser targets:
R_WASM_FUNCTION_OFFSET
family of relocations. This is needed because LLVM does not support emitting them for the data section. Verify first that the linker is able to process them, however.ExceptionDispatchInfo
functionality to be complete.WASI is harder... We could push for a stack trace API to be added upstream (for the second time); I think I could create a prototype for Wasmtime, but it would be anyone's guess when and if that goes through.
We can utilize the virtual unwind stack to capture stack traces, by linking all frames and disabling some optimizations, and that would work for Debug builds, but not for Release ones due to the overhead. Of course, stack traces in Debug is better than the current state of "nothing", but it would be much, much better if we could utilize the same approach as for browsers.
The text was updated successfully, but these errors were encountered: