servo: Merge #16899 - Revert "Replace intrinsics::abort with process::abort" (from jdm:revertabort); r=emilio

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 1312ab2b284c1a988c5029e1ec28ee9f3ea5e912

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 742d1055f4b540cca19040f50941f133a6bf094d
This commit is contained in:
Josh Matthews 2017-05-16 18:46:17 -05:00
parent 643cd662e4
commit f74528187b
3 changed files with 11 additions and 4 deletions

View File

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

View File

@ -12,7 +12,9 @@ macro_rules! stub(
#[allow(non_snake_case)]
pub extern "C" fn $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
#![feature(start)]
#![feature(start, core_intrinsics)]
#[cfg(target_os = "android")]
extern crate android_injected_glue;
@ -58,7 +58,7 @@ pub mod platform {
fn install_crash_handler() {
use backtrace::Backtrace;
use sig::ffi::Sig;
use std::process::abort;
use std::intrinsics::abort;
use std::thread;
fn handler(_sig: i32) {
@ -67,7 +67,11 @@ fn install_crash_handler() {
.map(|n| format!(" for thread \"{}\"", n))
.unwrap_or("".to_owned());
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