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
24 changes: 20 additions & 4 deletions centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ cc_library(
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/time",
"@abseil-cpp//absl/time:clock_interface",
"@com_google_fuzztest//common:crashing_input_filename",
"@com_google_fuzztest//common:defs",
"@com_google_fuzztest//common:hash",
Expand All @@ -915,6 +916,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 +1938,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
7 changes: 5 additions & 2 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);

// Sets signal handler for SIGINT.
// TODO(b/378532202): Replace this with a more generic mechanism that allows
// the called or `CentipedeMain()` to indicate when to stop.
Expand Down Expand Up @@ -557,9 +559,10 @@ int UpdateCorpusDatabase(Environment env,
crash_summary.Report(&std::cerr);
return exit_code;
}
OrganizeCrashingInputs(regression_dir, fuzztest_db_path / "crashing", env,
OrganizeCrashingInputs(regression_dir, fuzztest_db_path / "crashing",
fuzztest_db_path / "incubating", env,
callbacks_factory, crashes_by_signature, crash_summary,
stop_condition);
stop_condition, kDefaultRegressionTtl);
if (env.report_crash_summary) crash_summary.Report(&std::cerr);

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