rust-fuzz / afl.rs

🐇 Fuzzing Rust code with American Fuzzy Lop
https://rust-fuzz.github.io/book/afl.html
Apache License 2.0
1.62k stars 105 forks source link

separate binary and lib or their deps #130

Closed Trolldemorted closed 2 months ago

Trolldemorted commented 6 years ago

Right now it is cumbersome to fuzz libs that depend on afl.rs' dependencies, because they may require different versions.

Since the lib only offers two functions and uses nothing of the dependencies (?), I think we don't need them to be included in fuzz targets.

frewsxcv commented 6 years ago

which dependencies are you referring to? some of them get used in the cargo-afl binary. in what ways do you find working with the dependencies cumbersome?

Trolldemorted commented 6 years ago

We are fuzzing something also depending on clap, but a completely different version.

Since the fuzz target does not need clap we cloned afl.rs, removed everything cargo-afl related, built our fuzz-target, and ran it with cargo afl from crates.io.

frewsxcv commented 6 years ago

Relevant cargo issue https://github.com/rust-lang/cargo/issues/1982

frewsxcv commented 6 years ago

For what it's worth, you don't need to add 'afl' as a dependency in your cargo.toml. you should be able to just copy and paste these functions into your fuzz target

Trolldemorted commented 6 years ago

depending on a local, purged clone of afl.rs also works like a charm, we just wanted to let you know

smoelius commented 2 months ago

I think issue #335 was a duplicate of this one, and that issue is now closed.

Feel free to reopen if I have made a mistake.