rust-fuzz/libfuzzer

Use panic::set_hook to abort process

PaulGrandperrin opened this issue · 4 comments

Please see the rational and example implementation in this honggfuzz-rs commit:
rust-fuzz/honggfuzz-rs@abe2b4c

panic=abort should be able to work alongside plugins.

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`

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

@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:

  • when using cargo-fuzz, you can't fuzz things like proc_macro2.
  • when using targets, the fuzzer can't tell bugs apart.