image/fuzz-afl/README.md
Andreas Molzer f760637703
Update afl to 0.10, fix run issue
Work around an issue due to new pass-manager, as mentioned here:
<https://github.com/rust-fuzz/afl.rs/issues/192#issuecomment-931803722>

This affords us some time (until LLVM 14 or 15 iirc) for a more
permanent fix to appear upstream.
2021-10-02 20:58:11 +02:00

765 B

Fuzzing harnesses

This is intended for integration fuzzing and those decoders that do not yet live in their own crate. image-png for example has their own fuzzing targets.

Using the fuzzer

Install afl:

$ cargo install afl

Build fuzz target:

$ cargo afl build --bin fuzz_<format>

Run afl:

$ mkdir out/<format>
$ cargo afl fuzz -i ./in/<format> -o ./out/<format> ./target/debug/fuzz_<format>

To reproduce a crash:

$ cargo run --bin reproduce_<format>

Known issues

Since about Oct. 2021 the nightly Rust builds use an llvm version that no longer accepts one of the sanitizer passes. As a temporary workaround you must adjust the flags passed to afl:

$ RUSTFLAGS="-Znew-llvm-pass-manager=no" cargo +nightly afl run …