Skip to content
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

[ASAN] Turn off asan instrumentation in segv handler #46377

Merged
merged 1 commit into from
Aug 17, 2022
Merged

Conversation

Keno
Copy link
Member

@Keno Keno commented Aug 17, 2022

There's some issues around asan and segv handlers. The issues
I'm aware of is:

  1. If things run on the sigaltstack, we need to at some point unpoison
    the sigaltstack and it's not clear when to do that.
  2. Sanitizers accidentally free stil-in-use stack frames:
    asan fake stack can free live stack frames after longjmp/signal google/sanitizers#1561
  3. If noreturn functions run on the sigaltstack, asan can get confused
    about what it needs to unpoison

So for now, remove asan instrumentation from the segv_handler and
the the jl_call_in_ctx functions (jl_sig_throw is already annotated).
This helps the case I was seeing (where gc_srub would cause frequent
segv_handler invocations for safe restore), but there's probably a few
other landmines remaining here.

There's some issues around asan and segv handlers. The issues
I'm aware of is:

1. If things run on the sigaltstack, we need to at some point unpoison
   the sigaltstack and it's not clear when to do that.
2. Sanitizers accidentally free stil-in-use stack frames:
   google/sanitizers#1561
3. If noreturn functions run on the sigaltstack, asan can get confused
   about what it needs to unpoison

So for now, remove asan instrumentation from the segv_handler and
the the jl_call_in_ctx functions (jl_sig_throw is already annotated).
This helps the case I was seeing (where gc_srub would cause frequent
segv_handler invocations for safe restore), but there's probably a few
other landmines remaining here.
@Keno Keno mentioned this pull request Aug 17, 2022
60 tasks
@Keno Keno merged commit 4af9674 into master Aug 17, 2022
@Keno Keno deleted the kf/asansegv branch August 17, 2022 23:00
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.

1 participant