forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stack_overflow: Enable re-raising SIGSEGV / SIGBUS in their own handlers
By default, UNIX signals are blocked during their own handlers' execution, so `raise(signum)` from inside a handler was not actually getting delivered. Therefore the following instruction, `intrinsics::abort()`, was getting executed. This led to segfaulting Rust programs incorrectly having a termination status indicating SIGILL from the `abort()`, instead of SIGSEGV (or SIGBUS). We can use the `SA_NODEFER` flag to prevent this behavior. We can also use `SA_RESETHAND` to have the system reset the default signal handler for us upon entry, instead of doing that ourselves.
- Loading branch information
Showing
3 changed files
with
20 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters