diff --git a/Cargo.lock b/Cargo.lock index d5c41b0d23f..c1707a5eaa5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3640,6 +3640,7 @@ dependencies = [ "glutin 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", "keyboard-types 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "libservo 0.0.1", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-src 0.1.0 (git+https://github.com/servo/osmesa-src)", diff --git a/ports/servo/Cargo.toml b/ports/servo/Cargo.toml index 92335b487d2..1b90f319012 100644 --- a/ports/servo/Cargo.toml +++ b/ports/servo/Cargo.toml @@ -49,6 +49,7 @@ glutin = "0.19" keyboard-types = "0.4.3" lazy_static = "1" libservo = {path = "../../components/servo"} +libc = "0.2" log = "0.4" tinyfiledialogs = "3.0" winit = {version = "0.18", features = ["icon_loading"]} diff --git a/ports/servo/non_android_main.rs b/ports/servo/non_android_main.rs index 6bd465ce6e8..ba907451758 100644 --- a/ports/servo/non_android_main.rs +++ b/ports/servo/non_android_main.rs @@ -13,6 +13,7 @@ mod resources; mod browser; use backtrace::Backtrace; +use libc::_exit; use servo::{Servo, BrowserId}; use servo::compositing::windowing::WindowEvent; use servo::config::opts::{self, ArgumentParsingResult, parse_url_or_filename}; @@ -42,7 +43,6 @@ fn install_crash_handler() {} fn install_crash_handler() { use backtrace::Backtrace; use sig::ffi::Sig; - use std::intrinsics::abort; use std::thread; fn handler(_sig: i32) { @@ -52,9 +52,7 @@ fn install_crash_handler() { .unwrap_or("".to_owned()); println!("Stack trace{}\n{:?}", name, Backtrace::new()); unsafe { - // N.B. Using process::abort() here causes the crash handler to be - // triggered recursively. - abort(); + _exit(sig); } } diff --git a/tests/wpt/mozilla/meta/mozilla/sigsegv.html.ini b/tests/wpt/mozilla/meta/mozilla/sigsegv.html.ini index 7d4d878c05d..63ad264be81 100644 --- a/tests/wpt/mozilla/meta/mozilla/sigsegv.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/sigsegv.html.ini @@ -1,4 +1,4 @@ [sigsegv.html] type: testharness prefs: [dom.testbinding.enabled:true, dom.testable_crash.enabled:true] - disabled: https://github.com/servo/servo/issues/14067 + expected: CRASH