janestreet / janestreet/magic-trace

`setjmp`/`longjmp` support

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.