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

[release-1.6] backport signal handling improvements from #40056 #41774

Closed
wants to merge 1 commit into from

Conversation

JeffBezanson
Copy link
Member

Assuming 1.6 becomes the LTS release, I've gotten a request to backport this, which seems reasonable.

- don't smash the alt-stack when already using it
- handle jl_critical_error on the original stack, leaving our signal
handling thread free to handle more signals (and helping lock corruption
detection in some cases)
- unblock signals when handling signals: some libc apparently like to
block all signals, which can cause mild havoc, since we'd really like
the user or bad data to be able to still kill the process (and not just
be ignored or cause it to hang)
- reset signals to SIG_DFL earlier (so we recurse less)
- destroy some state from the Task we co-opted to run the exit handlers,
so that it can't accidentally jump back into the running program after
we've started tearing down the process, from an untimely ^C (previously
^C might cancel the exit) or a jlbacktrace call.
- mark functions as leaf with CFI instead of (potentially) smashing the
stack, and add a bit of red-zone if we are recursing (to keep pgcstack
sensible)
- support safe_restore for the mach catch_exception_raise (while we're
trying to generate the backtrace)

(cherry picked from commit 107901d)
@ViralBShah ViralBShah added the backport 1.6 Change should be backported to release-1.6 label Aug 8, 2021
@KristofferC KristofferC mentioned this pull request Aug 11, 2021
75 tasks
@vtjnash vtjnash changed the base branch from release-1.6 to backports-release-1.6 August 24, 2021 23:02
@vtjnash vtjnash changed the base branch from backports-release-1.6 to release-1.6 August 24, 2021 23:03
@vtjnash
Copy link
Member

vtjnash commented Aug 24, 2021

In the future, if you branch from the release-1.6-backports or before, this can be merged directly into that

@KristofferC
Copy link
Member

Included in #41554

@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Aug 25, 2021
@DilumAluthge DilumAluthge deleted the jb/signalhandling16 branch October 26, 2021 23:24
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.

4 participants