Skip to content

Commit

Permalink
Add comment about panic::set_hook() and reference cargo bug report
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulGrandperrin committed Apr 27, 2018
1 parent 05b9ffc commit 86bcaac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ pub fn initialize(_argc: *const isize, _argv: *const *const *const u8) -> isize
// Registers a panic hook that aborts the process before unwinding.
// It is useful to abort before unwinding so that the fuzzer will then be
// able to analyse the process stack frames to tell different bugs appart.
//
// HACK / FIXME: it would be better to use `-C panic=abort` but it's currently
// impossible to build code using compiler plugins with this flag.
// We will be able to remove this code when
// https://github.com/rust-lang/cargo/issues/5423 is fixed.
::std::panic::set_hook(Box::new(|_| {
::std::process::abort();
}));
Expand Down

0 comments on commit 86bcaac

Please sign in to comment.