Skip to content

Commit ea8d769

Browse files
authored
Override centipede default rss_limit_mb for Google/chromium targets (#5255)
#5207 updated this default only for reproduce() but changes the override location to also affect the the fuzz() and minimize_corpus() methods.
1 parent f314375 commit ea8d769

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • src/clusterfuzz/_internal/bot/fuzzers/centipede

src/clusterfuzz/_internal/bot/fuzzers/centipede/engine.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ def _get_arguments(self, fuzzer_path):
179179
if options:
180180
arguments = options.get_engine_arguments('centipede')
181181

182+
if constants.RSS_LIMIT_MB_FLAGNAME not in arguments and (
183+
utils.is_chromium() or utils.default_project_name() == "google"):
184+
arguments[constants.RSS_LIMIT_MB_FLAGNAME] = 0
185+
182186
# We ignore this parameter in the options file because it doesn't really
183187
# make sense not to crash on errors.
184188
arguments[constants.EXIT_ON_CRASH_FLAGNAME] = 1
@@ -426,15 +430,14 @@ def reproduce(self, target_path, input_path, arguments, max_time): # pylint: di
426430

427431
existing_runner_flags = os.environ.get('CENTIPEDE_RUNNER_FLAGS')
428432
if not existing_runner_flags:
433+
rss_limit = constants.RSS_LIMIT_MB_DEFAULT
429434
if constants.RSS_LIMIT_MB_FLAGNAME in fuzzer_arguments:
430435
rss_limit = fuzzer_arguments[constants.RSS_LIMIT_MB_FLAGNAME]
431-
elif (utils.is_chromium() or utils.default_project_name() == 'google'):
432-
rss_limit = 0
433-
else:
434-
rss_limit = constants.RSS_LIMIT_MB_DEFAULT
436+
435437
timeout = constants.TIMEOUT_PER_INPUT_REPR_DEFAULT
436438
if constants.TIMEOUT_PER_INPUT_FLAGNAME in fuzzer_arguments:
437439
timeout = fuzzer_arguments[constants.TIMEOUT_PER_INPUT_FLAGNAME]
440+
438441
os.environ['CENTIPEDE_RUNNER_FLAGS'] = (
439442
f':{constants.RSS_LIMIT_MB_FLAGNAME}={rss_limit}'
440443
f':{constants.TIMEOUT_PER_INPUT_FLAGNAME}={timeout}:')

0 commit comments

Comments
 (0)