mirror of
https://github.com/image-rs/image
synced 2024-10-18 16:52:23 +00:00
f760637703
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.
765 B
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 …