servo: Merge #12621 - Attach more signals to the backtrace signal handler (from jdm:sigabrt); r=emilio
authorJosh Matthews <josh@joshmatthews.net>
Thu, 28 Jul 2016 12:39:03 -0500
changeset 339388 a42af065b8c30eee5feaf85e41ceb163efcfb13c
parent 339387 b425092ab9a3e7405b55b096e605dcd599c2a00a
child 339389 dfff54cf3405218bec4a7079509efb6530ce1dab
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
servo: Merge #12621 - Attach more signals to the backtrace signal handler (from jdm:sigabrt); r=emilio These changes should enable meaningful backtraces in more unusual situations where the program would otherwise exit almost silently. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12618 (github issue number if applicable). - [X] These changes do not require tests because we can't verify the terminal output of the program in erroneous cases Source-Repo: https://github.com/servo/servo Source-Revision: 25f93b699fa4d1ad528514b58a36351b802653d9
servo/components/servo/main.rs
--- a/servo/components/servo/main.rs
+++ b/servo/components/servo/main.rs
@@ -65,17 +65,20 @@ fn install_crash_handler() {
                                     .map(|n| format!(" for thread \"{}\"", n))
                                     .unwrap_or("".to_owned());
         println!("Stack trace{}\n{:?}", name, Backtrace::new());
         unsafe {
             abort();
         }
     }
 
-    signal!(Sig::SEGV, handler);
+    signal!(Sig::SEGV, handler); // handle segfaults
+    signal!(Sig::ILL, handler); // handle stack overflow and unsupported CPUs
+    signal!(Sig::IOT, handler); // handle double panics
+    signal!(Sig::BUS, handler); // handle invalid memory access
 }
 
 #[cfg(target_os = "android")]
 fn install_crash_handler() {
 }
 
 fn main() {
     install_crash_handler();