janestreet / janestreet/magic-trace
`setjmp`/`longjmp` support
- Dominant language
- OCaml
- Stars
- 6.3k
- Forks
- 209
- PR merge metrics
- No merged PRs in 30d
Description
We cannot support arbitrary `_setjmp`/`longjmp`, but if we see a `longjmp` we can probably avoid totally breaking the trace by resetting the stack, and ignoring future `ret`s underflowing our call stack (because we wouldn't know how many stack frames should have gotten popped).
They appear as `Call "_setjmp"` and `Call "longjmp"` tokens in the stream.
Contributor guide
Research direction
Start by locating where `Call "_setjmp"` and `Call "longjmp"` tokens are consumed in the trace stream. Follow the call-stack handling around these tokens and define the completed behavior as resetting the stack at `longjmp` and safely ignoring subsequent underflowing `ret` tokens without breaking the trace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- devtools, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100