Skip to content

Cherry pick #117404 to 26.3: Fix out of bound in timeSeriesGroupArray() - #118551

Merged
robot-ch-test-poll2 merged 6 commits into
backport/26.3/117404from
cherrypick/26.3/117404
Sep 24, 2026
Merged

robot-ch-test-poll2 merged 6 commits into
backport/26.3/117404from
cherrypick/26.3/117404

Conversation

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

Original pull-request #117404

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

vitlibar and others added 5 commits September 1, 2026 20:35
The number of elements is read from the serialized state and was used for a single
allocation upfront, so a state claiming 2^60 or more elements made the size of the
allocation in bytes overflow and the following writes went past the allocated memory.
The array now grows while the data is read.
The count of samples in a bucket comes from the serialized state, so a small state could
ask for an arbitrarily large allocation. Only a bounded number of samples is reserved now
and the buffer grows while the samples are read.
The number of buckets is read from the serialized state and was only checked against
the bucket count derived from the function parameters. A huge window makes that count
enormous, so a tiny state could ask for an arbitrarily large allocation: an 18-byte
state of `timeSeriesChangesToGrid` allocated 1.25 GiB. Only a bounded number of buckets
is reserved now and the map grows while the buckets are read.
…es-grouparray

Fix out of bound in timeSeriesGroupArray()
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels Sep 7, 2026
@robot-ch-test-poll2

Copy link
Copy Markdown
Contributor

Dear @nikitamikhaylov, @vitlibar, this cherry-pick PR has not been updated for 3d0h1m38s. Please resolve the conflicts to backport #117404, or close this PR if the backport is no longer needed. This PR will be automatically closed after 7 days of inactivity.

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor Author

Dear @nikitamikhaylov, @vitlibar, this cherry-pick PR has not been updated for 7d0h12m57s. Closing automatically. If you still want to backport #117404, please resolve the conflicts and reopen this PR.

Merge the backport base while retaining the 26.3 time-series implementation.
Apply bounded sample reservations in the three release implementations that
precede the shared samples helper, and bound the outer bucket reservation.
Adapt the regression test to a large grid and cover each sample deserializer.

Related: #118551
Related: #117404
@robot-ch-test-poll2
robot-ch-test-poll2 merged commit b15774c into backport/26.3/117404 Sep 24, 2026
1 check passed
@robot-ch-test-poll2
robot-ch-test-poll2 deleted the cherrypick/26.3/117404 branch September 24, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants