From c5a0f0c7c640683f3d99b2be837b4dc525b241bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giovanni=20Ortu=C3=B1o=20Urquidi?= Date: Fri, 22 May 2026 17:56:53 -0400 Subject: [PATCH] Match libfuzzer's timeout for reproduction in centipede --- src/clusterfuzz/_internal/bot/fuzzers/centipede/engine.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/clusterfuzz/_internal/bot/fuzzers/centipede/engine.py b/src/clusterfuzz/_internal/bot/fuzzers/centipede/engine.py index d190145727..0a12cdf70a 100644 --- a/src/clusterfuzz/_internal/bot/fuzzers/centipede/engine.py +++ b/src/clusterfuzz/_internal/bot/fuzzers/centipede/engine.py @@ -432,9 +432,10 @@ def reproduce(self, target_path, input_path, arguments, max_time): # pylint: di rss_limit = 0 else: rss_limit = constants.RSS_LIMIT_MB_DEFAULT - timeout = constants.TIMEOUT_PER_INPUT_REPR_DEFAULT - if constants.TIMEOUT_PER_INPUT_FLAGNAME in fuzzer_arguments: - timeout = fuzzer_arguments[constants.TIMEOUT_PER_INPUT_FLAGNAME] + # Override fuzzer-defined timeouts to match libfuzzer's behavior in + # https://github.com/google/clusterfuzz/blob/d15a65e7753c6c6579f4b395c40e6d45a7bde262/src/clusterfuzz/_internal/bot/fuzzers/libfuzzer.py#L1255 + test_timeout = environment.get_value('TEST_TIMEOUT', constants.TIMEOUT_PER_INPUT_REPR_DEFAULT) + timeout = max(1, test_timeout - 5) os.environ['CENTIPEDE_RUNNER_FLAGS'] = ( f':{constants.RSS_LIMIT_MB_FLAGNAME}={rss_limit}' f':{constants.TIMEOUT_PER_INPUT_FLAGNAME}={timeout}:')