Skip to content

Backport #117536 to 26.3: Do not allocate from sizes declared in aggregate function states - #118529

Merged
Algunenano merged 1 commit into
26.3from
backport/26.3/117536
Sep 7, 2026
Merged

Algunenano merged 1 commit into
26.3from
backport/26.3/117536

Conversation

@robot-clickhouse-ci-2

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #117536
Cherry-pick pull-request #118142

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.33.6

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Sep 7, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [d6627c3]

Summary: ✅

@Algunenano
Algunenano merged commit 1600d83 into 26.3 Sep 7, 2026
34 checks passed
@Algunenano
Algunenano deleted the backport/26.3/117536 branch September 7, 2026 12:42
bytehalo-infra added a commit to sentioxyz/ClickHouse that referenced this pull request Sep 25, 2026
AGG: aggregate-function states that declare huge sizes -> the deserializers allocate for the declared size before
reading any data (1-32 GiB requests from a few bytes: OOM/DoS).
Effect in the production build a394e92: 15 of the 18 crafted states that ClickHouse#117536 added to upstream test 04401 fail
with MEMORY_LIMIT_EXCEEDED under a 100 MB limit, while official 26.8.8.8 reports the missing payload
(evidence/fix_ci_20260925/upstream_repro/corrected3/aggbomb_matrix_PROD263_UP2688.tsv). Upstream test 04401 itself cannot pass on 26.3: it also expects
the size caps of ClickHouse#108465, which was never backported to 26.3.
Upstream patch unchanged, with the backport's test 05055_aggregate_state_refill_staging (it passes on the production
build as well); the old-fail/new-pass test is the fork test 10319_aggregate_state_declared_size_no_allocation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants