Skip to content

Override centipede default rss_limit_mb for Google/chromium targets#5255

Merged
ViniciustCosta merged 1 commit intomasterfrom
push-lvmwnqszwllv
Apr 27, 2026
Merged

Override centipede default rss_limit_mb for Google/chromium targets#5255
ViniciustCosta merged 1 commit intomasterfrom
push-lvmwnqszwllv

Conversation

@aakallam
Copy link
Copy Markdown
Collaborator

#5207 updated this default only for reproduce() but changes the override location to also affect the the fuzz() and minimize_corpus() methods.

@aakallam aakallam force-pushed the push-lvmwnqszwllv branch from c36478f to ace2bf4 Compare April 27, 2026 15:23
@g-ortuno
Copy link
Copy Markdown
Collaborator

How is this done for libfuzzer? I'm curious why the libfuzzer change was a single line but we need to duplicate this for all task types. Seems a bit brittle :/

@aakallam
Copy link
Copy Markdown
Collaborator Author

This matches what libFuzzer is doing by overriding the flag whenever the fuzzer arguments are built from the fuzzer-specific config and the default config:

def get_arguments(fuzzer_path) -> options.FuzzerArguments:
"""Get arguments for a given fuzz target."""
arguments = options.FuzzerArguments()
rss_limit_mb = None
timeout = None
fuzzer_options = options.get_fuzz_target_options(fuzzer_path)
if fuzzer_options:
arguments = fuzzer_options.get_engine_arguments('libfuzzer')
rss_limit_mb = arguments.get('rss_limit_mb', constructor=int)
timeout = arguments.get('timeout', constructor=int)
if timeout is None:
arguments[constants.TIMEOUT_FLAGNAME] = constants.DEFAULT_TIMEOUT_LIMIT
if not rss_limit_mb and (utils.is_chromium() or
utils.default_project_name() == 'google'):
# TODO(metzman/alhijazi): Monitor if we are crashing the bots.
arguments[constants.RSS_LIMIT_FLAGNAME] = 0
elif not rss_limit_mb:
arguments[constants.RSS_LIMIT_FLAGNAME] = constants.DEFAULT_RSS_LIMIT_MB
else:
# psutil gives the total amount of memory in bytes, but we're only dealing
# with options that are counting memory space in MB, so we need to do the
# conversion first.
max_memory_limit_mb = (psutil.virtual_memory().total //
(1 << 20)) - constants.MEMORY_OVERHEAD
# Custom rss_limit_mb value shouldn't be greater than the actual memory
# allocated on the machine.
if rss_limit_mb > max_memory_limit_mb:
arguments[constants.RSS_LIMIT_FLAGNAME] = max_memory_limit_mb
return arguments

@g-ortuno
Copy link
Copy Markdown
Collaborator

Oh! I see, sorry, the commit message made me think that we changed the specific tasks to use the new value. LGTM!

@aakallam aakallam requested a review from g-ortuno April 27, 2026 16:26
Copy link
Copy Markdown
Collaborator

@g-ortuno g-ortuno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@aakallam aakallam marked this pull request as ready for review April 27, 2026 18:48
@aakallam aakallam requested a review from a team as a code owner April 27, 2026 18:48
#5207 updated this default only for reproduce() but changes the override location to also affect the the fuzz() and minimize_corpus() methods.
@aakallam aakallam force-pushed the push-lvmwnqszwllv branch from ace2bf4 to 6b8112c Compare April 27, 2026 18:48
@ViniciustCosta ViniciustCosta merged commit ea8d769 into master Apr 27, 2026
9 of 10 checks passed
@ViniciustCosta ViniciustCosta deleted the push-lvmwnqszwllv branch April 27, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants