[cfl] Allow longer to repro issues in Python (#9292)

Fixes #9222

Co-authored-by: Dongge Liu <donggeliu@google.com>
This commit is contained in:
jonathanmetzman 2023-01-10 01:40:59 -05:00 committed by GitHub
parent a366b1c90b
commit b6285aa410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -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