diff --git a/infra/cifuzz/config_utils.py b/infra/cifuzz/config_utils.py index 299b5c2dc10b..c2b5f7360148 100644 --- a/infra/cifuzz/config_utils.py +++ b/infra/cifuzz/config_utils.py @@ -200,6 +200,7 @@ def __init__(self): self.report_timeouts = environment.get_bool('REPORT_TIMEOUTS', False) self.report_ooms = environment.get_bool('REPORT_OOMS', True) + self.upload_all_crashes = environment.get_bool('UPLOAD_ALL_CRASHES', False) # TODO(metzman): Fix tests to create valid configurations and get rid of # CIFUZZ_TEST here and in presubmit.py. diff --git a/infra/cifuzz/fuzz_target.py b/infra/cifuzz/fuzz_target.py index 355d25a248cf..4743bd5b5d74 100644 --- a/infra/cifuzz/fuzz_target.py +++ b/infra/cifuzz/fuzz_target.py @@ -184,15 +184,17 @@ def fuzz(self, batch=False): crash = result.crashes[0] logging.info('Fuzzer: %s. Detected bug.', self.target_name) - if self.is_crash_reportable(crash.input_path, - crash.reproduce_args, - batch=batch): - # We found a bug in the fuzz target and we will report it. - saved_path = self._save_crash(crash) - return FuzzResult(saved_path, result.logs, self.latest_corpus_path) - - # We found a bug but we won't report it. - return FuzzResult(None, None, self.latest_corpus_path) + is_reportable = self.is_crash_reportable(crash.input_path, + crash.reproduce_args, + batch=batch) + if is_reportable or self.config.upload_all_crashes: + fuzzer_logs = result.logs + testcase_path = self._save_crash(crash) + else: + fuzzer_logs = None + testcase_path = None + + return FuzzResult(testcase_path, fuzzer_logs, self.latest_corpus_path) def free_disk_if_needed(self, delete_fuzz_target=True): """Deletes things that are no longer needed from fuzzing this fuzz target to diff --git a/infra/cifuzz/run_fuzzers.py b/infra/cifuzz/run_fuzzers.py index d42ad23eb941..18171da48e82 100644 --- a/infra/cifuzz/run_fuzzers.py +++ b/infra/cifuzz/run_fuzzers.py @@ -136,7 +136,7 @@ def run_fuzz_targets(self): fuzzers_left_to_run -= 1 if not result.testcase or not result.stacktrace: - logging.info('Fuzzer %s finished running without crashes.', + logging.info('Fuzzer %s finished running without reportable crashes.', target.target_name) continue