Skip to content

CI: bump rss_limit_mb to 4096 for clickhouse_fuzzer to stop chronic OOMs at 2048 Mb default - #105134

Merged
yakov-olkhovskiy merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/fix-clickhouse-fuzzer-oom
May 16, 2026
Merged

yakov-olkhovskiy merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/fix-clickhouse-fuzzer-oom

Conversation

@groeneai

@groeneai groeneai commented May 16, 2026 •

Copy link
Copy Markdown
Collaborator

clickhouse_fuzzer runs the full clickhouse-local binary (see programs/local/fuzzers/clickhouse_fuzzer.cpp, which constructs a clickhouseMain thread on each fuzz iteration). That spins up a complete clickhouse-server-grade runtime: JeMalloc arenas, OpenSSL initialization, static initializers, full query execution machinery. Baseline RSS sits very close to the libFuzzer default rss_limit_mb=2048, so any fuzzed input that triggers even moderate query-time allocations pushes the process past the limit.

CIDB shows the failure has been chronic and uniform across many unrelated PRs:

libFuzzer  out-of-memory (used: 2049-2056Mb; limit: 2048Mb)  oom-<hash>

Last 30 days (all 10 hits — 0 on master because libFuzzer does not run regularly on master):

Every single failure is OOM at the 2048 Mb limit with actual usage just barely over (2049-2056 Mb). Hash-prefix of oom-* samples varies (7a597, 90c3e, 32ab8, da39a, f33b9), confirming multiple distinct trigger inputs that all sit right at the boundary.

Fix

Add rss_limit_mb = 4096 to tests/fuzz/clickhouse_fuzzer.options, following the existing precedent for fuzzers with similar workloads:

Fuzzer rss_limit_mb
execute_query_fuzzer.options 4096
data_type_deserialization_fuzzer.options 4096
create_parser_fuzzer.options 6144
clickhouse_fuzzer.options (this PR) 4096

The limit still bounds the target (it does not disable the check via rss_limit_mb=0), so genuine memory regressions above 4 GB will still be caught.

Sample CIDB query used to gather the data:

SELECT pull_request_number, count(), max(check_start_time), any(test_context_raw)
FROM default.checks
WHERE test_name = 'clickhouse_fuzzer'
  AND test_status IN ('FAIL', 'ERROR')
  AND check_start_time > now() - INTERVAL 30 DAY
GROUP BY pull_request_number
ORDER BY count() DESC

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Bump libFuzzer rss_limit_mb to 4096 for clickhouse_fuzzer to fix chronic OOMs at the 2048 Mb default. Matches the existing precedent of execute_query_fuzzer and other heavyweight fuzz targets.

Documentation entry for user-facing changes

  • Not required (CI-only configuration change)

Version info

  • Merged into: 26.5.1.712

`clickhouse_fuzzer` runs the full `clickhouse-local` binary (see
`programs/local/fuzzers/clickhouse_fuzzer.cpp`) which spins up a complete
clickhouse-server-grade runtime: JeMalloc arenas, OpenSSL initializer,
static initializers, and full query execution. Baseline RSS is close to
the libFuzzer default `rss_limit_mb=2048`, so fuzzed inputs that trigger
even moderate query-time allocations push the process past the limit.

CIDB shows 7 unrelated PRs in 7 days all hitting OOM at 2049-2056 Mb —
just barely over the 2048 Mb default. Failure mode is uniform:

    libFuzzer  out-of-memory (used: 2049-2056Mb; limit: 2048Mb)  oom-<hash>

Bumping to 4096 Mb follows existing precedent for fuzzers with similar
workloads:
  - `execute_query_fuzzer.options`: rss_limit_mb = 4096 (also runs query
    execution; same author bumped this in commit bafb7d7)
  - `data_type_deserialization_fuzzer.options`: rss_limit_mb = 4096
  - `create_parser_fuzzer.options`: rss_limit_mb = 6144

The limit still bounds the target (it does not disable the check via
`rss_limit_mb=0`), so genuine memory regressions above 4 GB will still
be caught.

CIDB evidence (last 30 days, all 10 hits — 0 on master because libFuzzer
does not run on master regularly):
    PR ClickHouse#99740  (4 hits, Apr 19-21)
    PR ClickHouse#104231, ClickHouse#104849, ClickHouse#104956, ClickHouse#96844, ClickHouse#104510, ClickHouse#104492  (1 hit each,
    May 13-15)
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate (per TASK.md Phase 4 step 9)

Session id: cron:clickhouse-ci-task-worker:20260516-194500

(a) Deterministic repro? Yes — the failure mode is a documented libFuzzer behavior: when target RSS exceeds rss_limit_mb, libFuzzer kills the target and writes an oom-<hash> artifact. CIDB shows 10 hits across 7 unrelated PRs over 30 days, all reporting out-of-memory (used: 2049-2056Mb; limit: 2048Mb) — the value is consistently 1-8 Mb over the default 2048 Mb limit, which is deterministic CI evidence of a too-tight limit rather than a transient memory spike.

(b) Root cause explained? Yes. clickhouse_fuzzer (built from programs/local/fuzzers/clickhouse_fuzzer.cpp) spawns a clickhouseMain thread that runs the full clickhouse-local binary on each fuzz iteration. That brings in JeMalloc arenas (sized per-CPU on a 32-core CI runner), OpenSSL initialization, all server-grade static initializers, and full query execution machinery — baseline RSS sits very close to 2 GB even before any fuzzed query runs. Adding any non-trivial allocation during a query push the process past the 2048 Mb default. Same author (@yakov-olkhovskiy) hit the same problem in execute_query_fuzzer and create_parser_fuzzer (which run similar but smaller workloads) and bumped those to 4096 and 6144 respectively; this PR extends that pattern to clickhouse_fuzzer, which is heavier than either of them.

(c) Fix matches root cause? Yes. The fix directly addresses the limit-vs-baseline mismatch by raising rss_limit_mb to 4096, matching the precedent set in execute_query_fuzzer.options (4096) and data_type_deserialization_fuzzer.options (4096). It does not disable the check (rss_limit_mb=0 would do that), so genuine memory regressions above 4 GB will still surface.

(d) Test intent preserved? Yes. The fuzzer still runs, still detects OOMs (anything above 4 GB), and the rss bound is still active. The change does not weaken what the fuzzer can catch — it removes the false-positive noise floor near baseline RSS.

(e) Both directions demonstrated? The deterministic CI evidence (10 hits / 7 unrelated PRs / 30 days, all OOM at 2049-2056 Mb against 2048 Mb) demonstrates the failure without the fix. Verification with the fix will come from absence of OOM hits on subsequent CI runs after merge — I will follow up on CIDB and close the tracking task once we have ≥48h of clean libFuzzer runs.

(f) Fix is general? Not applicable — this is a single-line CI configuration change in one .options file, bounded to the clickhouse_fuzzer target. No code paths are affected. The sibling .options files were checked (grep -l rss_limit_mb tests/fuzz/*.options); the three other fuzzers that benefit from a similar bump (execute_query_fuzzer, data_type_deserialization_fuzzer, create_parser_fuzzer) already have it.

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @yakov-olkhovskiy @maxknv @alexey-milovidov — could you review this one-line fuzzer config change? It bumps rss_limit_mb for clickhouse_fuzzer from the libFuzzer default 2048 to 4096, matching the precedent set in execute_query_fuzzer.options and data_type_deserialization_fuzzer.options. @yakov-olkhovskiy in particular: you set the rss_limit on the three sibling fuzzers (commits bafb7d7aa288, 7241c735b2b0, e9453b722aee) — this is the same pattern for clickhouse_fuzzer, which runs the full clickhouse-local binary and has been hitting the 2048 Mb default across 7 unrelated PRs in the last week.

@yakov-olkhovskiy yakov-olkhovskiy self-assigned this May 16, 2026
@yakov-olkhovskiy yakov-olkhovskiy added the can be tested Allows running workflows for external contributors label May 16, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [99394c6]

Summary: ✅


AI Review

Summary

This PR raises rss_limit_mb to 4096 in tests/fuzz/clickhouse_fuzzer.options to reduce chronic libFuzzer OOM failures near the default 2048 MB limit. I reviewed the PR discussion, current diff, and related fuzzer option/runner behavior, and I did not find unresolved correctness, safety, or performance concerns in the current code.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label May 16, 2026
@yakov-olkhovskiy
yakov-olkhovskiy added this pull request to the merge queue May 16, 2026
Merged via the queue into ClickHouse:master with commit 445525f May 16, 2026
167 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label May 16, 2026
alexey-milovidov pushed a commit to Onyx2406/ClickHouse that referenced this pull request May 19, 2026
…c OOMs

`create_parser_fuzzer` has been failing chronically with `libFuzzer
out-of-memory` for weeks, with the actual usage sitting just above the
hardcoded 6144 Mb limit. CIDB shows 55 OOM hits across 49 unrelated PRs
in the last 30 days (peaking at 17 hits / 17 PRs on 2026-05-17 alone).

The reported `used:` values cluster around 6221-7329 Mb (avg 6554 Mb,
p95 7329 Mb, max 8830 Mb). 54 of 55 observed OOMs (98%) fall under
8192 Mb. The 6144 limit is essentially at the typical working-set
mean for this fuzzer, so any input that triggers even moderate
extra allocations during parsing trips the limit.

Bump `rss_limit_mb` from 6144 to 8192 to match the chronic working set,
following the same precedent as PR ClickHouse#105134 which bumped `clickhouse_fuzzer`
from 2048 to 4096 for the same class of "just-barely-over-the-limit"
chronic OOMs.

The limit is still active (8 GB is not unlimited), so genuine large
memory regressions above 8 GB will still be caught.

Sibling change: PR ClickHouse#104922 (merged) bumped `select_parser_fuzzer`
via `max_parser_backtracks`. This PR addresses the parallel
`create_parser_fuzzer` family.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants