The replayer should execute all files that are passed as corpus to a cc_fuzz_test target.
Actual Behavior
Corpus files in a hidden (. prefixed directory) or hidden files are ignored by the replayer as long as the hidden directory/file lies in the bazel project root.
Steps to Reproduce the Problem
Apply the following patch, which adds a corpus file in a hidden directory for the bzlmod example:
diff --git a/examples/bzlmod/.seed-corpus/foo b/examples/bzlmod/.seed-corpus/foo
new file mode 100644
index 0000000..e69de29
diff --git a/examples/bzlmod/BUILD b/examples/bzlmod/BUILD
index 7333e6c..387c268 100644
--- a/examples/bzlmod/BUILD
+++ b/examples/bzlmod/BUILD
@@ -18,6 +18,7 @@ load("@my_rules_fuzzing//fuzzing:java_defs.bzl", "java_fuzz_test")
cc_fuzz_test(
name = "cc_fuzz_test",
srcs = ["cc_fuzz_test.cc"],
+ corpus = [".seed-corpus/foo"],
)
java_fuzz_test(
diff --git a/examples/bzlmod/cc_fuzz_test.cc b/examples/bzlmod/cc_fuzz_test.cc
index b08b002..e6a07b9 100644
--- a/examples/bzlmod/cc_fuzz_test.cc
+++ b/examples/bzlmod/cc_fuzz_test.cc
@@ -16,7 +16,9 @@
#include <cstddef>
#include <cstdint>
+#include <iostream>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ throw std::runtime_error("Executing corpus file");
return 0;
}
In the examples/bzlmod directory run bazel coverage //:cc_fuzz_test.
The replayer should replay the .seed-corpus/foo and trigger the inserted exception in LLVMFuzzerTestOneInput. Instead, the coverage calculation passes without executing a corpus file.
Expected Behavior
The replayer should execute all files that are passed as
corpus
to acc_fuzz_test
target.Actual Behavior
Corpus files in a hidden (
.
prefixed directory) or hidden files are ignored by the replayer as long as the hidden directory/file lies in the bazel project root.Steps to Reproduce the Problem
bzlmod
example:examples/bzlmod
directory runbazel coverage //:cc_fuzz_test
.The replayer should replay the
.seed-corpus/foo
and trigger the inserted exception inLLVMFuzzerTestOneInput
. Instead, the coverage calculation passes without executing a corpus file.Specifications