fuzz: Shuffle files before testing them

When iterating over all fuzz input files in a folder, the order should
not matter.

However, shuffling may be useful to detect non-determinism.

Thus, shuffle in fuzz.cpp, when using neither libFuzzer, nor AFL.

Also, shuffle in the deterministic-fuzz-coverage tool, when using
libFuzzer.
This commit is contained in:
MarcoFalke
2025-04-07 12:01:25 +02:00
parent 639279e86a
commit faf2e238fb
2 changed files with 10 additions and 3 deletions

View File

@ -133,7 +133,7 @@ fn deterministic_coverage(
let output = {
let mut cmd = Command::new(fuzz_exe);
if using_libfuzzer {
cmd.arg("-runs=1");
cmd.args(["-runs=1", "-shuffle=1", "-prefer_small=0"]);
}
cmd
}