Auto merge of #16899 - jdm:revertabort, r=emilio

Revert "Replace intrinsics::abort with process::abort"

This reverts #16680. Calling `process::abort` from the crash handler causes the crash handler to be invoked again recursively.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16898

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16899)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-16 18:46:17 -05:00 committed by GitHub
commit 1312ab2b28
3 changed files with 11 additions and 4 deletions

View file

@ -4,6 +4,7 @@
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(core_intrinsics)]
#![feature(link_args)] #![feature(link_args)]
#[macro_use] #[macro_use]

View file

@ -12,7 +12,9 @@ macro_rules! stub(
#[allow(non_snake_case)] #[allow(non_snake_case)]
pub extern "C" fn $name() { pub extern "C" fn $name() {
println!("CEF stub function called: {}", stringify!($name)); println!("CEF stub function called: {}", stringify!($name));
::std::process::abort() unsafe {
::std::intrinsics::abort()
}
} }
) )
); );

View file

@ -15,7 +15,7 @@
//! //!
//! [glutin]: https://github.com/tomaka/glutin //! [glutin]: https://github.com/tomaka/glutin
#![feature(start)] #![feature(start, core_intrinsics)]
#[cfg(target_os = "android")] #[cfg(target_os = "android")]
extern crate android_injected_glue; extern crate android_injected_glue;
@ -58,7 +58,7 @@ pub mod platform {
fn install_crash_handler() { fn install_crash_handler() {
use backtrace::Backtrace; use backtrace::Backtrace;
use sig::ffi::Sig; use sig::ffi::Sig;
use std::process::abort; use std::intrinsics::abort;
use std::thread; use std::thread;
fn handler(_sig: i32) { fn handler(_sig: i32) {
@ -67,7 +67,11 @@ fn install_crash_handler() {
.map(|n| format!(" for thread \"{}\"", n)) .map(|n| format!(" for thread \"{}\"", n))
.unwrap_or("".to_owned()); .unwrap_or("".to_owned());
println!("Stack trace{}\n{:?}", name, Backtrace::new()); println!("Stack trace{}\n{:?}", name, Backtrace::new());
abort(); unsafe {
// N.B. Using process::abort() here causes the crash handler to be
// triggered recursively.
abort();
}
} }
signal!(Sig::SEGV, handler); // handle segfaults signal!(Sig::SEGV, handler); // handle segfaults