From 4cc3aa63437c2b2e59c84ded347a060cc4093914 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Wed, 31 Mar 2021 06:55:30 -0700 Subject: [CIFuzz] Print crash stacktraces no matter what (#5474) Even if we don't want to report them, print the stacktrace. Related: https://github.com/google/oss-fuzz/issues/5461 --- infra/cifuzz/fuzz_target.py | 7 ++++++- infra/cifuzz/run_fuzzers.py | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'infra') diff --git a/infra/cifuzz/fuzz_target.py b/infra/cifuzz/fuzz_target.py index e2beebd77..c623bf60d 100644 --- a/infra/cifuzz/fuzz_target.py +++ b/infra/cifuzz/fuzz_target.py @@ -141,8 +141,14 @@ class FuzzTarget: if not testcase: logging.error(b'No testcase found in stacktrace: %s.', stderr) return FuzzResult(None, None) + + utils.binary_print(b'Fuzzer: %s. Detected bug:\n%s' % + (self.target_name.encode(), stderr)) if self.is_crash_reportable(testcase): + # We found a bug in the fuzz target and we will report it. return FuzzResult(testcase, stderr) + + # We found a bug but we won't report it. return FuzzResult(None, None) def free_disk_if_needed(self): @@ -271,7 +277,6 @@ class FuzzTarget: logging.info('The crash is reproducible. The crash doesn\'t reproduce ' 'on old builds. This code change probably introduced the ' 'crash.') - return True logging.info('The crash is reproducible on old builds ' diff --git a/infra/cifuzz/run_fuzzers.py b/infra/cifuzz/run_fuzzers.py index d00109e3e..513cfb6fa 100644 --- a/infra/cifuzz/run_fuzzers.py +++ b/infra/cifuzz/run_fuzzers.py @@ -145,10 +145,6 @@ class BaseFuzzTargetRunner: target.target_name) continue - # We found a bug in the fuzz target. - utils.binary_print(b'Fuzzer: %s. Detected bug:\n%s' % - (target.target_name.encode(), result.stacktrace)) - # TODO(metzman): Do this with filestore. testcase_artifact_path = self.get_fuzz_target_artifact( target, os.path.basename(result.testcase)) -- cgit v1.2.3