Polyfill SA_RESETHAND on MacOS ARM64

This change solves the XNU crash loop mystery. Apple's documentation
claims to support this feature, but they only define the constant in
their header files. The kernel acknowledges thi SA_RESETHAND bit, by
clearing it from the sa_flags state, returns zero, and does nothing.
This commit is contained in:
Justine Tunney 2024-05-08 03:47:43 -07:00
parent 952b9009e8
commit 793393a341
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 23 additions and 2 deletions

View file

@ -394,8 +394,6 @@ relegated void __oncrash(int sig, struct siginfo *si, void *arg) {
BLOCK_CANCELATION;
SpinLock(&lock);
__oncrash_impl(sig, si, arg);
if (sig != SIGQUIT && sig != SIGTRAP)
_exit(1);
SpinUnlock(&lock);
ALLOW_CANCELATION;
}