Repository navigation
Cherry pick #117404 to 26.3: Fix out of bound in timeSeriesGroupArray() - #118551
Merged
robot-ch-test-poll2 merged 6 commits intoSep 24, 2026
Merged
Conversation
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.
…-timeseries-grouparray
…es-grouparray Fix out of bound in timeSeriesGroupArray()
robot-clickhouse
force-pushed
the
backport/26.3/117404
branch
from
September 9, 2026 14:56
61cca2d to
1136e7f
Compare
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. |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-picklocally.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:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job