Skip to content

Commit 7110dca

Browse files
lowdaniecopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 943413342
1 parent b8aad15 commit 7110dca

11 files changed

Lines changed: 897 additions & 358 deletions

centipede/BUILD

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ cc_library(
906906
"@abseil-cpp//absl/status:statusor",
907907
"@abseil-cpp//absl/strings",
908908
"@abseil-cpp//absl/time",
909+
"@abseil-cpp//absl/time:clock_interface",
909910
"@com_google_fuzztest//common:crashing_input_filename",
910911
"@com_google_fuzztest//common:defs",
911912
"@com_google_fuzztest//common:hash",
@@ -915,6 +916,22 @@ cc_library(
915916
],
916917
)
917918

919+
cc_library(
920+
name = "crash_deduplication_test_util",
921+
testonly = 1,
922+
srcs = ["crash_deduplication_test_util.cc"],
923+
hdrs = ["crash_deduplication_test_util.h"],
924+
deps = [
925+
":centipede_callbacks",
926+
":environment",
927+
":runner_result",
928+
":stop",
929+
"@abseil-cpp//absl/container:flat_hash_map",
930+
"@abseil-cpp//absl/types:span",
931+
"@com_google_fuzztest//common:defs",
932+
],
933+
)
934+
918935
cc_library(
919936
name = "crash_summary",
920937
srcs = ["crash_summary.cc"],
@@ -1921,18 +1938,17 @@ cc_test(
19211938
deps = [
19221939
":centipede_callbacks",
19231940
":crash_deduplication",
1941+
":crash_deduplication_test_util",
19241942
":crash_summary",
19251943
":environment",
1926-
":runner_result",
19271944
":stop",
19281945
":util",
19291946
":workdir",
19301947
"@abseil-cpp//absl/container:flat_hash_map",
19311948
"@abseil-cpp//absl/strings:str_format",
19321949
"@abseil-cpp//absl/time",
1933-
"@abseil-cpp//absl/types:span",
1934-
"@com_google_fuzztest//common:defs",
1935-
"@com_google_fuzztest//common:hash",
1950+
"@abseil-cpp//absl/time:clock_interface",
1951+
"@abseil-cpp//absl/time:simulated_clock",
19361952
"@com_google_fuzztest//common:temp_dir",
19371953
"@googletest//:gtest_main",
19381954
],

centipede/centipede_interface.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ namespace fuzztest::internal {
7474

7575
namespace {
7676

77+
constexpr absl::Duration kDefaultRegressionTtl = absl::Hours(24 * 7);
78+
7779
// Sets signal handler for SIGINT.
7880
// TODO(b/378532202): Replace this with a more generic mechanism that allows
7981
// the called or `CentipedeMain()` to indicate when to stop.
@@ -557,9 +559,10 @@ int UpdateCorpusDatabase(Environment env,
557559
crash_summary.Report(&std::cerr);
558560
return exit_code;
559561
}
560-
OrganizeCrashingInputs(regression_dir, fuzztest_db_path / "crashing", env,
562+
OrganizeCrashingInputs(regression_dir, fuzztest_db_path / "crashing",
563+
fuzztest_db_path / "incubating", env,
561564
callbacks_factory, crashes_by_signature, crash_summary,
562-
stop_condition);
565+
stop_condition, kDefaultRegressionTtl);
563566
if (env.report_crash_summary) crash_summary.Report(&std::cerr);
564567

565568
// Distill and store the coverage corpus.

0 commit comments

Comments
 (0)