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 committed 2025-04-09 20:04:38 +02:00
1 parent 639279e86a
commit faf2e238fb
2 files changed
+10 -3

No files matched your search

@@ -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
}