Don't panic inside sig handler (#2958)
* fix_handler * hello * fmt --------- Co-authored-by: Your Name <you@example.com>
This commit is contained in:
parent
2c741c8f38
commit
404227d1a3
@ -53,10 +53,10 @@ pub mod unix_signal_handler {
|
|||||||
let data = &raw mut GLOBAL_STATE;
|
let data = &raw mut GLOBAL_STATE;
|
||||||
let in_handler = (*data).set_in_handler(true);
|
let in_handler = (*data).set_in_handler(true);
|
||||||
|
|
||||||
assert!(
|
if in_handler {
|
||||||
!in_handler,
|
log::error!("We crashed inside a crash handler, but this should never happen!");
|
||||||
"We crashed inside a crash handler, but this should never happen!"
|
libc::exit(56);
|
||||||
);
|
}
|
||||||
|
|
||||||
match signal {
|
match signal {
|
||||||
Signal::SigUser2 | Signal::SigAlarm => {
|
Signal::SigUser2 | Signal::SigAlarm => {
|
||||||
@ -98,10 +98,10 @@ pub mod unix_signal_handler {
|
|||||||
let data = &raw mut GLOBAL_STATE;
|
let data = &raw mut GLOBAL_STATE;
|
||||||
let in_handler = (*data).set_in_handler(true);
|
let in_handler = (*data).set_in_handler(true);
|
||||||
|
|
||||||
assert!(
|
if in_handler {
|
||||||
!in_handler,
|
log::error!("We crashed inside a crash panic hook, but this should never happen!");
|
||||||
"We crashed inside a crash panic hook, but this should never happen!"
|
libc::exit(56);
|
||||||
);
|
}
|
||||||
|
|
||||||
if (*data).is_valid() {
|
if (*data).is_valid() {
|
||||||
// We are fuzzing!
|
// We are fuzzing!
|
||||||
|
@ -5,7 +5,7 @@ pub mod windows_asan_handler {
|
|||||||
use core::sync::atomic::{compiler_fence, Ordering};
|
use core::sync::atomic::{compiler_fence, Ordering};
|
||||||
|
|
||||||
use windows::Win32::System::Threading::{
|
use windows::Win32::System::Threading::{
|
||||||
EnterCriticalSection, LeaveCriticalSection, CRITICAL_SECTION,
|
EnterCriticalSection, ExitProcess, LeaveCriticalSection, CRITICAL_SECTION,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -36,10 +36,10 @@ pub mod windows_asan_handler {
|
|||||||
let data = &raw mut GLOBAL_STATE;
|
let data = &raw mut GLOBAL_STATE;
|
||||||
let in_handler = (*data).set_in_handler(true);
|
let in_handler = (*data).set_in_handler(true);
|
||||||
|
|
||||||
assert!(
|
if in_handler {
|
||||||
!in_handler,
|
log::error!("We crashed inside a asan death handler, but this should never happen!");
|
||||||
"We crashed inside a asan death handler, but this should never happen!"
|
ExitProcess(56);
|
||||||
);
|
}
|
||||||
|
|
||||||
// Have we set a timer_before?
|
// Have we set a timer_before?
|
||||||
if (*data).ptp_timer.is_some() {
|
if (*data).ptp_timer.is_some() {
|
||||||
@ -166,10 +166,10 @@ pub mod windows_exception_handler {
|
|||||||
let data = &raw mut GLOBAL_STATE;
|
let data = &raw mut GLOBAL_STATE;
|
||||||
let in_handler = (*data).set_in_handler(true);
|
let in_handler = (*data).set_in_handler(true);
|
||||||
|
|
||||||
assert!(
|
if in_handler {
|
||||||
!in_handler,
|
log::error!("We crashed inside a crash handler, but this should never happen!");
|
||||||
"We crashed inside a crash handler, but this should never happen!"
|
ExitProcess(56);
|
||||||
);
|
}
|
||||||
|
|
||||||
if !(*data).crash_handler.is_null() {
|
if !(*data).crash_handler.is_null() {
|
||||||
let func: HandlerFuncPtr = transmute((*data).crash_handler);
|
let func: HandlerFuncPtr = transmute((*data).crash_handler);
|
||||||
@ -206,10 +206,10 @@ pub mod windows_exception_handler {
|
|||||||
let data = &raw mut GLOBAL_STATE;
|
let data = &raw mut GLOBAL_STATE;
|
||||||
let in_handler = (*data).set_in_handler(true);
|
let in_handler = (*data).set_in_handler(true);
|
||||||
|
|
||||||
assert!(
|
if in_handler {
|
||||||
!in_handler,
|
log::error!("We crashed inside a crash handler, but this should never happen!");
|
||||||
"We crashed inside a panic hook, but this should never happen!"
|
ExitProcess(56);
|
||||||
);
|
}
|
||||||
|
|
||||||
// Have we set a timer_before?
|
// Have we set a timer_before?
|
||||||
if (*data).ptp_timer.is_some() {
|
if (*data).ptp_timer.is_some() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user