File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 11
11
//
12
12
// This uses `signal()` instead of `sigaction()` for Windows support
13
13
// (SIGSEGV is one of the rare supported signals)
14
+ //
15
+ // Note that Rust also has a SIGSEGV handler to catch stack overflows. In
16
+ // this case it displays an informative message and aborts the program (no
17
+ // segfaults in Rust!). Ideally we'd save the Rust handler and notify
18
+ // it. However the only safe way to notify an old handler on Unixes is to
19
+ // use `sigaction()` so that we get the information needed to determine the
20
+ // type of handler (old or new school). So we'd need to make a different
21
+ // implementation for Windows (which only supports old style) and for Unix,
22
+ // and this doesn't seem worth it.
14
23
pub fn register_trap_handlers ( ) {
15
24
unsafe {
16
25
libc:: signal ( libc:: SIGBUS , backtrace_handler as libc:: sighandler_t ) ;
You can’t perform that action at this time.
0 commit comments