Skip to content

Reset stack after longjmp#381

Open
Abhishek21g wants to merge 5 commits into
janestreet:masterfrom
Abhishek21g:abhishek/longjmp-stack-reset
Open

Reset stack after longjmp#381
Abhishek21g wants to merge 5 commits into
janestreet:masterfrom
Abhishek21g:abhishek/longjmp-stack-reset

Conversation

@Abhishek21g

Copy link
Copy Markdown

Summary

  • reset the inferred call stack when a longjmp-style symbol is called
  • suppress return-underflow noise after the non-local jump until a normal call establishes a new stack
  • recognize common libc/glibc variants, including versioned symbols such as longjmp@@GLIBC_...
  • add an expect test for the longjmp symbol classifier

Fixes #35.

Notes

This intentionally does not try to reconstruct the exact skipped frames from setjmp/longjmp; the branch stream does not contain enough information to know how many frames were unwound. Instead, it follows the issue's suggested fallback: close the currently inferred stack and avoid fabricating noisy [unknown] frames from the unmatched rets that can follow.

Validation

  • git diff --check
  • make attempted locally, but this machine does not have dune installed:
    make: dune: No such file or directory

Linux validation still needed

dune build
dune runtest

Signed-off-by: Abhishek Enaguthi <enaguthiabhishek@gmail.com>
Signed-off-by: Abhishek Enaguthi <enaguthiabhishek@gmail.com>
Signed-off-by: Abhishek Enaguthi <enaguthiabhishek@gmail.com>
Signed-off-by: Abhishek Enaguthi <enaguthiabhishek@gmail.com>
Signed-off-by: Abhishek Enaguthi <enaguthiabhishek@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setjmp/longjmp support

1 participant