2020-01-29 19:03:43 +00:00
|
|
|
# Copyright 2020 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
"""A module to handle running a fuzz target for a specified amount of time."""
|
2021-02-04 15:15:51 +00:00
|
|
|
import collections
|
2020-01-29 19:03:43 +00:00
|
|
|
import logging
|
|
|
|
import os
|
2021-03-12 15:27:07 +00:00
|
|
|
import shutil
|
2020-02-27 23:33:00 +00:00
|
|
|
import stat
|
2021-10-27 01:24:26 +00:00
|
|
|
import tempfile
|
2020-01-29 19:03:43 +00:00
|
|
|
|
2021-09-13 02:16:13 +00:00
|
|
|
import clusterfuzz.environment
|
|
|
|
import clusterfuzz.fuzz
|
|
|
|
|
2021-10-04 15:21:28 +00:00
|
|
|
import config_utils
|
2021-10-26 02:18:17 +00:00
|
|
|
import logs
|
2021-10-04 15:21:28 +00:00
|
|
|
|
2021-10-26 02:18:17 +00:00
|
|
|
logs.init()
|
2020-01-29 19:03:43 +00:00
|
|
|
|
2021-11-03 03:22:12 +00:00
|
|
|
# Use len_control=0 since we don't have enough time fuzzing for len_control to
|
|
|
|
# make sense (probably).
|
|
|
|
LIBFUZZER_OPTIONS_BATCH = ['-len_control=0']
|
|
|
|
# Use a fixed seed for determinism for code change fuzzing.
|
|
|
|
LIBFUZZER_OPTIONS_CODE_CHANGE = LIBFUZZER_OPTIONS_BATCH + ['-seed=1337']
|
2021-12-14 14:46:16 +00:00
|
|
|
LIBFUZZER_OPTIONS_NO_REPORT_OOM = ['-rss_limit_mb=0']
|
2020-02-04 18:54:28 +00:00
|
|
|
|
2020-02-26 16:47:13 +00:00
|
|
|
# The number of reproduce attempts for a crash.
|
|
|
|
REPRODUCE_ATTEMPTS = 10
|
|
|
|
|
2021-09-24 05:46:13 +00:00
|
|
|
REPRODUCE_TIME_SECONDS = 30
|
|
|
|
|
2020-05-28 17:14:57 +00:00
|
|
|
# Seconds on top of duration until a timeout error is raised.
|
2020-03-04 22:58:09 +00:00
|
|
|
BUFFER_TIME = 10
|
|
|
|
|
2021-02-03 20:46:19 +00:00
|
|
|
# Log message if we can't check if crash reproduces on an recent build.
|
2021-06-18 17:26:36 +00:00
|
|
|
COULD_NOT_TEST_ON_CLUSTERFUZZ_MESSAGE = (
|
|
|
|
'Could not run previous build of target to determine if this code change '
|
|
|
|
'(pr/commit) introduced crash. Assuming crash was newly introduced.')
|
2020-05-28 17:14:57 +00:00
|
|
|
|
2021-05-26 17:09:21 +00:00
|
|
|
FuzzResult = collections.namedtuple('FuzzResult',
|
|
|
|
['testcase', 'stacktrace', 'corpus_path'])
|
2021-02-04 15:15:51 +00:00
|
|
|
|
2020-05-28 17:14:57 +00:00
|
|
|
|
|
|
|
class ReproduceError(Exception):
|
|
|
|
"""Error for when we can't attempt to reproduce a crash."""
|
|
|
|
|
2020-01-29 19:03:43 +00:00
|
|
|
|
2021-08-10 18:10:10 +00:00
|
|
|
def get_fuzz_target_corpus_dir(workspace, target_name):
|
|
|
|
"""Returns the directory for storing |target_name|'s corpus in |workspace|."""
|
|
|
|
return os.path.join(workspace.corpora, target_name)
|
|
|
|
|
|
|
|
|
|
|
|
def get_fuzz_target_pruned_corpus_dir(workspace, target_name):
|
|
|
|
"""Returns the directory for storing |target_name|'s puned corpus in
|
|
|
|
|workspace|."""
|
|
|
|
return os.path.join(workspace.pruned_corpora, target_name)
|
|
|
|
|
|
|
|
|
2021-06-30 14:34:42 +00:00
|
|
|
class FuzzTarget: # pylint: disable=too-many-instance-attributes
|
2020-01-29 19:03:43 +00:00
|
|
|
"""A class to manage a single fuzz target.
|
|
|
|
|
|
|
|
Attributes:
|
|
|
|
target_name: The name of the fuzz target.
|
|
|
|
duration: The length of time in seconds that the target should run.
|
|
|
|
target_path: The location of the fuzz target binary.
|
2021-06-30 14:34:42 +00:00
|
|
|
workspace: The workspace for storing things related to fuzzing.
|
2020-01-29 19:03:43 +00:00
|
|
|
"""
|
|
|
|
|
2021-02-01 18:49:33 +00:00
|
|
|
# pylint: disable=too-many-arguments
|
2021-06-30 14:34:42 +00:00
|
|
|
def __init__(self, target_path, duration, workspace, clusterfuzz_deployment,
|
2021-02-03 20:46:19 +00:00
|
|
|
config):
|
2020-01-29 19:03:43 +00:00
|
|
|
"""Represents a single fuzz target.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
target_path: The location of the fuzz target binary.
|
|
|
|
duration: The length of time in seconds the target should run.
|
2021-06-30 14:34:42 +00:00
|
|
|
workspace: The path used for storing things needed for fuzzing.
|
2021-02-03 20:46:19 +00:00
|
|
|
clusterfuzz_deployment: The object representing the ClusterFuzz
|
|
|
|
deployment.
|
|
|
|
config: The config of this project.
|
2020-01-29 19:03:43 +00:00
|
|
|
"""
|
|
|
|
self.target_path = target_path
|
2021-02-01 18:49:33 +00:00
|
|
|
self.target_name = os.path.basename(self.target_path)
|
|
|
|
self.duration = int(duration)
|
2021-06-30 14:34:42 +00:00
|
|
|
self.workspace = workspace
|
2021-02-03 20:46:19 +00:00
|
|
|
self.clusterfuzz_deployment = clusterfuzz_deployment
|
|
|
|
self.config = config
|
2021-08-10 18:10:10 +00:00
|
|
|
self.latest_corpus_path = get_fuzz_target_corpus_dir(
|
|
|
|
self.workspace, self.target_name)
|
|
|
|
os.makedirs(self.latest_corpus_path, exist_ok=True)
|
|
|
|
self.pruned_corpus_path = get_fuzz_target_pruned_corpus_dir(
|
|
|
|
self.workspace, self.target_name)
|
|
|
|
os.makedirs(self.pruned_corpus_path, exist_ok=True)
|
|
|
|
|
|
|
|
def _download_corpus(self):
|
|
|
|
"""Downloads the corpus for the target from ClusterFuzz and returns the path
|
|
|
|
to the corpus. An empty directory is provided if the corpus can't be
|
|
|
|
downloaded or is empty."""
|
|
|
|
self.clusterfuzz_deployment.download_corpus(self.target_name,
|
|
|
|
self.latest_corpus_path)
|
|
|
|
return self.latest_corpus_path
|
|
|
|
|
2021-10-27 01:24:26 +00:00
|
|
|
def _target_artifact_path(self):
|
|
|
|
"""Target artifact path."""
|
|
|
|
artifact_path = os.path.join(self.workspace.artifacts, self.target_name,
|
|
|
|
self.config.sanitizer)
|
|
|
|
os.makedirs(artifact_path, exist_ok=True)
|
|
|
|
return artifact_path
|
|
|
|
|
|
|
|
def _save_crash(self, crash):
|
|
|
|
"""Add stacktraces to crashes."""
|
|
|
|
target_reproducer_path = os.path.join(self._target_artifact_path(),
|
|
|
|
os.path.basename(crash.input_path))
|
|
|
|
shutil.copy(crash.input_path, target_reproducer_path)
|
|
|
|
|
|
|
|
bug_summary_artifact_path = target_reproducer_path + '.summary'
|
2021-11-04 13:34:32 +00:00
|
|
|
with open(bug_summary_artifact_path, 'w') as handle:
|
|
|
|
handle.write(crash.stacktrace)
|
|
|
|
|
2021-10-27 01:24:26 +00:00
|
|
|
return target_reproducer_path
|
|
|
|
|
2021-08-10 18:10:10 +00:00
|
|
|
def prune(self):
|
|
|
|
"""Prunes the corpus and returns the result."""
|
|
|
|
self._download_corpus()
|
2021-09-13 02:16:13 +00:00
|
|
|
with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE,
|
|
|
|
self.config.sanitizer,
|
|
|
|
self.target_path,
|
|
|
|
interactive=True):
|
|
|
|
engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE)
|
|
|
|
result = engine_impl.minimize_corpus(self.target_path, [],
|
|
|
|
[self.latest_corpus_path],
|
|
|
|
self.pruned_corpus_path,
|
2021-10-27 01:24:26 +00:00
|
|
|
self._target_artifact_path(),
|
2021-09-13 02:16:13 +00:00
|
|
|
self.duration)
|
|
|
|
|
|
|
|
return FuzzResult(None, result.logs, self.pruned_corpus_path)
|
|
|
|
|
2021-11-03 03:22:12 +00:00
|
|
|
def fuzz(self, batch=False):
|
2020-01-29 19:03:43 +00:00
|
|
|
"""Starts the fuzz target run for the length of time specified by duration.
|
|
|
|
|
|
|
|
Returns:
|
2021-02-04 15:15:51 +00:00
|
|
|
FuzzResult namedtuple with stacktrace and testcase if applicable.
|
2020-01-29 19:03:43 +00:00
|
|
|
"""
|
2021-06-23 14:30:11 +00:00
|
|
|
logging.info('Running fuzzer: %s.', self.target_name)
|
2020-03-13 17:35:33 +00:00
|
|
|
|
2021-09-13 02:16:13 +00:00
|
|
|
self._download_corpus()
|
|
|
|
corpus_path = self.latest_corpus_path
|
|
|
|
|
|
|
|
logging.info('Starting fuzzing')
|
2021-10-27 01:24:26 +00:00
|
|
|
with tempfile.TemporaryDirectory() as artifacts_dir:
|
|
|
|
with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE,
|
|
|
|
self.config.sanitizer,
|
|
|
|
self.target_path,
|
|
|
|
interactive=True) as env:
|
|
|
|
engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE)
|
|
|
|
options = engine_impl.prepare(corpus_path, env.target_path,
|
|
|
|
env.build_dir)
|
|
|
|
options.merge_back_new_testcases = False
|
|
|
|
options.analyze_dictionary = False
|
2021-11-03 03:22:12 +00:00
|
|
|
if batch:
|
|
|
|
options.arguments.extend(LIBFUZZER_OPTIONS_BATCH)
|
|
|
|
else:
|
|
|
|
options.arguments.extend(LIBFUZZER_OPTIONS_CODE_CHANGE)
|
2021-10-27 01:24:26 +00:00
|
|
|
|
2021-12-14 14:46:16 +00:00
|
|
|
if not self.config.report_ooms:
|
|
|
|
options.arguments.extend(LIBFUZZER_OPTIONS_NO_REPORT_OOM)
|
|
|
|
|
2021-10-27 01:24:26 +00:00
|
|
|
result = engine_impl.fuzz(self.target_path, options, artifacts_dir,
|
|
|
|
self.duration)
|
|
|
|
|
|
|
|
if not result.crashes:
|
2021-11-02 12:01:46 +00:00
|
|
|
# Libfuzzer max time was reached.
|
2021-10-27 01:24:26 +00:00
|
|
|
logging.info('Fuzzer %s finished with no crashes discovered.',
|
|
|
|
self.target_name)
|
|
|
|
return FuzzResult(None, None, self.latest_corpus_path)
|
|
|
|
|
|
|
|
# Only report first crash.
|
|
|
|
crash = result.crashes[0]
|
2021-11-02 05:50:59 +00:00
|
|
|
logging.info('Fuzzer: %s. Detected bug.', self.target_name)
|
2021-10-27 01:24:26 +00:00
|
|
|
|
2021-12-13 17:04:04 +00:00
|
|
|
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)
|
2020-02-12 22:44:11 +00:00
|
|
|
|
2021-06-25 15:42:10 +00:00
|
|
|
def free_disk_if_needed(self, delete_fuzz_target=True):
|
2021-03-12 15:27:07 +00:00
|
|
|
"""Deletes things that are no longer needed from fuzzing this fuzz target to
|
|
|
|
save disk space if needed."""
|
|
|
|
if not self.config.low_disk_space:
|
2021-06-25 15:42:10 +00:00
|
|
|
logging.info('Not freeing disk space after running fuzz target.')
|
2021-03-12 15:27:07 +00:00
|
|
|
return
|
2021-06-25 15:42:10 +00:00
|
|
|
logging.info('Deleting corpus and seed corpus of %s to save disk.',
|
|
|
|
self.target_name)
|
2021-03-12 15:27:07 +00:00
|
|
|
|
|
|
|
# Delete the seed corpus, corpus, and fuzz target.
|
2021-08-10 18:10:10 +00:00
|
|
|
for corpus_path in [self.latest_corpus_path, self.pruned_corpus_path]:
|
2021-03-15 16:20:13 +00:00
|
|
|
# Use ignore_errors=True to fix
|
|
|
|
# https://github.com/google/oss-fuzz/issues/5383.
|
2021-08-10 18:10:10 +00:00
|
|
|
shutil.rmtree(corpus_path, ignore_errors=True)
|
2021-03-12 15:27:07 +00:00
|
|
|
|
|
|
|
target_seed_corpus_path = self.target_path + '_seed_corpus.zip'
|
|
|
|
if os.path.exists(target_seed_corpus_path):
|
|
|
|
os.remove(target_seed_corpus_path)
|
2021-06-25 15:42:10 +00:00
|
|
|
|
|
|
|
if delete_fuzz_target:
|
|
|
|
logging.info('Deleting fuzz target: %s.', self.target_name)
|
|
|
|
os.remove(self.target_path)
|
2021-03-12 15:27:07 +00:00
|
|
|
logging.info('Done deleting.')
|
|
|
|
|
2021-11-02 12:01:46 +00:00
|
|
|
def is_reproducible(self, testcase, target_path, reproduce_args):
|
2020-11-17 21:39:57 +00:00
|
|
|
"""Checks if the testcase reproduces.
|
2020-02-12 22:44:11 +00:00
|
|
|
|
|
|
|
Args:
|
2020-11-17 21:39:57 +00:00
|
|
|
testcase: The path to the testcase to be tested.
|
2020-02-19 23:32:30 +00:00
|
|
|
target_path: The path to the fuzz target to be tested
|
2021-11-02 12:01:46 +00:00
|
|
|
reproduce_args: The arguments to pass to the target to reproduce the
|
|
|
|
crash.
|
2020-02-12 22:44:11 +00:00
|
|
|
|
|
|
|
Returns:
|
2020-05-28 17:14:57 +00:00
|
|
|
True if crash is reproducible and we were able to run the
|
|
|
|
binary.
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
ReproduceError if we can't attempt to reproduce the crash.
|
2020-02-12 22:44:11 +00:00
|
|
|
"""
|
2020-05-28 17:14:57 +00:00
|
|
|
if not os.path.exists(target_path):
|
2021-07-22 19:52:07 +00:00
|
|
|
logging.info('Target: %s does not exist.', target_path)
|
2021-06-17 18:26:42 +00:00
|
|
|
raise ReproduceError(f'Target {target_path} not found.')
|
2020-05-28 17:14:57 +00:00
|
|
|
|
|
|
|
os.chmod(target_path, stat.S_IRWXO)
|
|
|
|
|
2021-09-24 05:46:13 +00:00
|
|
|
logging.info('Trying to reproduce crash using: %s.', testcase)
|
|
|
|
with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE,
|
|
|
|
self.config.sanitizer,
|
|
|
|
target_path,
|
2021-10-26 02:18:17 +00:00
|
|
|
interactive=False):
|
2021-09-24 05:46:13 +00:00
|
|
|
for _ in range(REPRODUCE_ATTEMPTS):
|
|
|
|
engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE)
|
2021-12-14 16:32:18 +00:00
|
|
|
try:
|
|
|
|
result = engine_impl.reproduce(target_path,
|
|
|
|
testcase,
|
|
|
|
arguments=reproduce_args,
|
|
|
|
max_time=REPRODUCE_TIME_SECONDS)
|
|
|
|
except TimeoutError as error:
|
|
|
|
logging.error('%s.', error)
|
|
|
|
return False
|
2021-08-05 20:27:24 +00:00
|
|
|
|
2021-09-24 05:46:13 +00:00
|
|
|
if result.return_code != 0:
|
|
|
|
logging.info('Reproduce command returned: %s. Reproducible on %s.',
|
|
|
|
result.return_code, target_path)
|
2020-05-28 17:14:57 +00:00
|
|
|
|
2021-09-24 05:46:13 +00:00
|
|
|
return True
|
2020-05-28 17:14:57 +00:00
|
|
|
|
2021-09-24 05:46:13 +00:00
|
|
|
logging.info('Reproduce command returned: 0. Not reproducible on %s.',
|
2020-05-28 17:14:57 +00:00
|
|
|
target_path)
|
2020-02-12 22:44:11 +00:00
|
|
|
return False
|
2020-01-29 19:03:43 +00:00
|
|
|
|
2021-11-03 14:10:42 +00:00
|
|
|
def is_crash_reportable(self, testcase, reproduce_args, batch=False):
|
2020-05-28 17:14:57 +00:00
|
|
|
"""Returns True if a crash is reportable. This means the crash is
|
2021-02-03 20:46:19 +00:00
|
|
|
reproducible but not reproducible on a build from the ClusterFuzz deployment
|
|
|
|
(meaning the crash was introduced by this PR/commit/code change).
|
2020-02-19 23:32:30 +00:00
|
|
|
|
|
|
|
Args:
|
2020-11-17 21:39:57 +00:00
|
|
|
testcase: The path to the testcase that triggered the crash.
|
2021-11-02 12:01:46 +00:00
|
|
|
reproduce_args: The arguments to pass to the target to reproduce the
|
|
|
|
crash.
|
2020-02-19 23:32:30 +00:00
|
|
|
|
|
|
|
Returns:
|
|
|
|
True if the crash was introduced by the current pull request.
|
2020-05-28 17:14:57 +00:00
|
|
|
|
|
|
|
Raises:
|
|
|
|
ReproduceError if we can't attempt to reproduce the crash on the PR build.
|
2020-02-19 23:32:30 +00:00
|
|
|
"""
|
2021-11-02 12:01:46 +00:00
|
|
|
|
|
|
|
if not self.is_crash_type_reportable(testcase):
|
|
|
|
return False
|
|
|
|
|
2020-11-17 21:39:57 +00:00
|
|
|
if not os.path.exists(testcase):
|
2021-06-17 18:26:42 +00:00
|
|
|
raise ReproduceError(f'Testcase {testcase} not found.')
|
2020-05-28 17:14:57 +00:00
|
|
|
|
|
|
|
try:
|
2021-02-03 20:46:19 +00:00
|
|
|
reproducible_on_code_change = self.is_reproducible(
|
2021-11-02 12:01:46 +00:00
|
|
|
testcase, self.target_path, reproduce_args)
|
2020-05-28 17:14:57 +00:00
|
|
|
except ReproduceError as error:
|
2021-06-18 17:26:36 +00:00
|
|
|
logging.error('Could not check for crash reproducibility.'
|
2020-05-28 17:14:57 +00:00
|
|
|
'Please file an issue:'
|
|
|
|
'https://github.com/google/oss-fuzz/issues/new.')
|
|
|
|
raise error
|
|
|
|
|
2021-02-03 20:46:19 +00:00
|
|
|
if not reproducible_on_code_change:
|
2021-06-18 17:26:36 +00:00
|
|
|
logging.info('Crash is not reproducible.')
|
2021-07-29 15:41:36 +00:00
|
|
|
return self.config.report_unreproducible_crashes
|
2020-02-19 23:32:30 +00:00
|
|
|
|
2021-06-18 17:26:36 +00:00
|
|
|
logging.info('Crash is reproducible.')
|
2021-11-03 14:10:42 +00:00
|
|
|
if batch:
|
|
|
|
# We don't need to check if the crash is novel for batch fuzzing.
|
|
|
|
return True
|
|
|
|
|
2021-11-02 12:01:46 +00:00
|
|
|
return self.is_crash_novel(testcase, reproduce_args)
|
|
|
|
|
|
|
|
def is_crash_type_reportable(self, testcase):
|
|
|
|
"""Returns True if |testcase| is an actual crash. If crash is a timeout or
|
|
|
|
OOM then returns True if config says we should report those."""
|
|
|
|
# TODO(metzman): Use a less hacky method.
|
|
|
|
testcase = os.path.basename(testcase)
|
|
|
|
if testcase.startswith('oom-'):
|
|
|
|
return self.config.report_ooms
|
|
|
|
if testcase.startswith('timeout-'):
|
|
|
|
return self.config.report_timeouts
|
|
|
|
return True
|
2021-05-26 17:09:21 +00:00
|
|
|
|
2021-11-02 12:01:46 +00:00
|
|
|
def is_crash_novel(self, testcase, reproduce_args):
|
2021-05-26 17:09:21 +00:00
|
|
|
"""Returns whether or not the crash is new. A crash is considered new if it
|
|
|
|
can't be reproduced on an older ClusterFuzz build of the target."""
|
2021-06-18 17:26:36 +00:00
|
|
|
if not os.path.exists(testcase):
|
|
|
|
raise ReproduceError('Testcase %s not found.' % testcase)
|
2021-06-30 14:34:42 +00:00
|
|
|
clusterfuzz_build_dir = self.clusterfuzz_deployment.download_latest_build()
|
2021-02-03 20:46:19 +00:00
|
|
|
if not clusterfuzz_build_dir:
|
|
|
|
# Crash is reproducible on PR build and we can't test on a recent
|
|
|
|
# ClusterFuzz/OSS-Fuzz build.
|
2021-06-18 17:26:36 +00:00
|
|
|
logging.info(COULD_NOT_TEST_ON_CLUSTERFUZZ_MESSAGE)
|
2020-05-28 17:14:57 +00:00
|
|
|
return True
|
2020-02-19 23:32:30 +00:00
|
|
|
|
2021-02-03 20:46:19 +00:00
|
|
|
clusterfuzz_target_path = os.path.join(clusterfuzz_build_dir,
|
|
|
|
self.target_name)
|
2021-06-18 17:26:36 +00:00
|
|
|
|
2020-05-28 17:14:57 +00:00
|
|
|
try:
|
2021-02-03 20:46:19 +00:00
|
|
|
reproducible_on_clusterfuzz_build = self.is_reproducible(
|
2021-11-02 12:01:46 +00:00
|
|
|
testcase, clusterfuzz_target_path, reproduce_args)
|
2020-05-28 17:14:57 +00:00
|
|
|
except ReproduceError:
|
2021-02-03 20:46:19 +00:00
|
|
|
# This happens if the project has ClusterFuzz builds, but the fuzz target
|
2020-05-28 17:14:57 +00:00
|
|
|
# is not in it (e.g. because the fuzz target is new).
|
2021-06-18 17:26:36 +00:00
|
|
|
logging.info(COULD_NOT_TEST_ON_CLUSTERFUZZ_MESSAGE)
|
2020-05-28 17:14:57 +00:00
|
|
|
return True
|
2020-02-19 23:32:30 +00:00
|
|
|
|
2021-06-18 17:26:36 +00:00
|
|
|
if reproducible_on_clusterfuzz_build:
|
|
|
|
logging.info('The crash is reproducible on previous build. '
|
|
|
|
'Code change (pr/commit) did not introduce crash.')
|
|
|
|
return False
|
2021-07-22 19:52:07 +00:00
|
|
|
logging.info('The crash is not reproducible on previous build. '
|
2021-06-18 17:26:36 +00:00
|
|
|
'Code change (pr/commit) introduced crash.')
|
|
|
|
return True
|