Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ package(default_visibility = DEFAULT_VISIBILITY)

licenses(["notice"])

exports_files([
"crash_deduplication.h",
"crash_deduplication.cc",
])

################################################################################
# Binaries
################################################################################
Expand Down Expand Up @@ -907,6 +912,8 @@ cc_library(
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/time",
"@abseil-cpp//absl/time:clock_interface",
"@abseil-cpp//absl/types:span",
"@com_google_fuzztest//common:crashing_input_filename",
"@com_google_fuzztest//common:defs",
"@com_google_fuzztest//common:hash",
Expand All @@ -916,6 +923,22 @@ cc_library(
],
)

cc_library(
name = "crash_deduplication_test_util",
testonly = 1,
srcs = ["crash_deduplication_test_util.cc"],
hdrs = ["crash_deduplication_test_util.h"],
deps = [
":centipede_callbacks",
":environment",
":runner_result",
":stop",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/types:span",
"@com_google_fuzztest//common:defs",
],
)

cc_library(
name = "crash_summary",
srcs = ["crash_summary.cc"],
Expand Down Expand Up @@ -1921,18 +1944,17 @@ cc_test(
deps = [
":centipede_callbacks",
":crash_deduplication",
":crash_deduplication_test_util",
":crash_summary",
":environment",
":runner_result",
":stop",
":util",
":workdir",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/strings:str_format",
"@abseil-cpp//absl/time",
"@abseil-cpp//absl/types:span",
"@com_google_fuzztest//common:defs",
"@com_google_fuzztest//common:hash",
"@abseil-cpp//absl/time:clock_interface",
"@abseil-cpp//absl/time:simulated_clock",
"@com_google_fuzztest//common:temp_dir",
"@googletest//:gtest_main",
],
Expand Down
13 changes: 10 additions & 3 deletions centipede/centipede_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ namespace fuzztest::internal {

namespace {

constexpr absl::Duration kDefaultRegressionTtl = absl::Hours(24 * 7);

// Runs env.for_each_blob on every blob extracted from env.args.
// Returns EXIT_SUCCESS on success, EXIT_FAILURE otherwise.
void ForEachBlob(const Environment& env, StopCondition& stop_condition) {
Expand Down Expand Up @@ -546,9 +548,14 @@ void UpdateCorpusDatabase(Environment env,
crash_summary.Report(&std::cerr);
return;
}
OrganizeCrashingInputs(regression_dir, fuzztest_db_path / "crashing", env,
callbacks_factory, crashes_by_signature, crash_summary,
stop_condition);
if (const absl::Status status = OrganizeCrashingInputs(
regression_dir, fuzztest_db_path / "crashing",
fuzztest_db_path / "incubating", env, callbacks_factory,
crashes_by_signature, crash_summary, stop_condition,
kDefaultRegressionTtl);
!status.ok()) {
FUZZTEST_LOG(ERROR) << "Failed to organize crashing inputs: " << status;
}
if (env.report_crash_summary) crash_summary.Report(&std::cerr);

// Distill and store the coverage corpus.
Expand Down
Loading
Loading