cargo-fuzz
cargo-fuzz copied to clipboard
Corpus minimization breaks symlinks
I have a multi crate project with multiple separate fuzzing crates.
The corpus is stored in one git submodule and I was sym linking all the corpora, unfortunately, the corpus minimization command cmin breaks these symlinks because it moves them around and removes them latter.
https://github.com/rust-fuzz/cargo-fuzz/blob/a7052a09ee20e872b63a74e9746972855313ad16/src/project.rs#L585
Before running cargo fuzz min equivalence:
ls -lh corpus
total 0
lrwxrwxrwx 1 kubuxu kubuxu 55 Mar 29 03:17 equivalence -> ../../../../testing/fuzz-corpora/corpus/amt_equivalence/
After:
ls -lh corpus
total 52K
drwxr-xr-x 2 kubuxu kubuxu 36K Mar 29 03:06 equivalence/
The directory layout of the fuzz-corpora/corpus/amt_equivalence is forced due to ClusterFuzzLite because I use a crate-based prefix amt in this case.
A possible workaround for me would be to remove the prefix and name each target accordingly but I hoped to avoid that.