Skip to content

Commit 7fac9a4

Browse files
committed
Handle SIGILL as well
1 parent 2e9fe78 commit 7fac9a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/stdext/src/traps.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
//
66
//
77

8-
// Call this after initialising the `log` package. Instruments SIGBUS and
9-
// SIGSEGV to generate a backtrace with `info` verbosity (lowest level so
10-
// it's always reported).
8+
// Call this after initialising the `log` package. Instruments SIGBUS,
9+
// SIGSEGV, and SIGILL to generate a backtrace with `info` verbosity
10+
// (lowest level so it's always reported).
1111
//
1212
// This uses `signal()` instead of `sigaction()` for Windows support
1313
// (SIGSEGV is one of the rare supported signals)
@@ -24,6 +24,7 @@ pub fn register_trap_handlers() {
2424
unsafe {
2525
libc::signal(libc::SIGBUS, backtrace_handler as libc::sighandler_t);
2626
libc::signal(libc::SIGSEGV, backtrace_handler as libc::sighandler_t);
27+
libc::signal(libc::SIGILL, backtrace_handler as libc::sighandler_t);
2728
}
2829
}
2930

0 commit comments

Comments
 (0)