rust-fuzz / libfuzzer

Rust bindings and utilities for LLVM’s libFuzzer
Apache License 2.0
208 stars 44 forks source link

Use panic::set_hook to abort process #31

Closed PaulGrandperrin closed 6 years ago

PaulGrandperrin commented 6 years ago

Please see the rational and example implementation in this honggfuzz-rs commit: https://github.com/rust-fuzz/honggfuzz-rs/commit/abe2b4c93121e6fdca498e7e1645f63c9d41369d

nagisa commented 6 years ago

panic=abort should be able to work alongside plugins.

PaulGrandperrin commented 6 years ago

I know but it doesn't... building a target fuzzing proc_macro2 with panic=abort gives:

error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort`
PaulGrandperrin commented 6 years ago

And anyway, it's still useful if the user overrides (accidentally or not) the panic strategy.

PaulGrandperrin commented 6 years ago

@nagisa , it's possible to fuzz proc_macro2 in the targets repository because in this repository panic=abort is not used : https://github.com/rust-fuzz/targets/blob/7b1c464276cca4c7b95080f7652bc8633315720f/cli.rs#L264

So it means that: