WebAssembly / WebAssembly/component-model
Idea: support post-trap call traces for guest interpreters
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 1.4k
- Forks
- 130
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Description
While discussing this componentize-py issue, I realized it would be useful to allow a component to be entered one last time after it traps in order to get additional debug info.
For example, if a trap occurs while running Python code in the CPython interpreter, the guest stack trace produced by Wasmtime is usually pretty useless; what we really want is a Python-level stack trace, and that can only realistically be produced by executing guest code. More generally, it would be nice to be able to attach a Python-level debugger to the interpreter to do an interactive investigation; either way, we'd need to execute guest code.
One possible solution to this would be to allow the host to export a special on-trap function which the host may call after the trap happens, similar to how a signal handler would run after e.g. a SIGSEGV occurs. Presumably that function would be restricted from calling any imports and, in the simple case, take no parameters and return only a string containing a high-level call trace. Attaching a debugger would require a more sophisticated interface, of course, but we could start simple and expand from there.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing this proposal and the linked componentize-py issue 146; no source files, tests, or implementation entry points are named. Define and agree on the post-trap execution model, restrictions, return values, and debugger scope before implementation. Done means the Component Model behavior and its validation plan are specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100