From b6285aa410b6b494dc342688d3698c8dec641cd4 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Tue, 10 Jan 2023 01:40:59 -0500 Subject: [PATCH] [cfl] Allow longer to repro issues in Python (#9292) Fixes #9222 Co-authored-by: Dongge Liu --- infra/cifuzz/fuzz_target.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/infra/cifuzz/fuzz_target.py b/infra/cifuzz/fuzz_target.py index c51ca29e9..5a5ca5189 100644 --- a/infra/cifuzz/fuzz_target.py +++ b/infra/cifuzz/fuzz_target.py @@ -38,7 +38,10 @@ LIBFUZZER_OPTIONS_NO_REPORT_OOM = ['-rss_limit_mb=0'] # The number of reproduce attempts for a crash. REPRODUCE_ATTEMPTS = 10 -REPRODUCE_TIME_SECONDS = 30 +DEFAULT_REPRODUCE_TIME_SECONDS = 30 +PER_LANGUAGE_REPRODUCE_TIMEOUTS = { + 'python': 30 * 4 # Python takes a bit longer on startup. +} MINIMIZE_TIME_SECONDS = 60 * 4 # Seconds on top of duration until a timeout error is raised. @@ -284,13 +287,15 @@ class FuzzTarget: # pylint: disable=too-many-instance-attributes with clusterfuzz.environment.Environment(config_utils.DEFAULT_ENGINE, self.config.sanitizer, target_path): + reproduce_time_seconds = PER_LANGUAGE_REPRODUCE_TIMEOUTS.get( + self.config.language, DEFAULT_REPRODUCE_TIME_SECONDS) for _ in range(REPRODUCE_ATTEMPTS): engine_impl = clusterfuzz.fuzz.get_engine(config_utils.DEFAULT_ENGINE) try: result = engine_impl.reproduce(target_path, testcase, arguments=reproduce_args, - max_time=REPRODUCE_TIME_SECONDS) + max_time=reproduce_time_seconds) except TimeoutError as error: logging.error('%s.', error) return False