Repository navigation
Fix heap-use-after-free in GraphiteRollupSortedAlgorithm - #98609
Merged
Merged
Conversation
When an exception occurs during `mergeBlock` with a `GraphiteMergeTree` table (e.g. fuzzed column types like `Int128` for the `Time` column), the aggregate state in `GraphiteRollupMergedData` can be left active. On destruction, the derived class member `params` (owning the patterns vector with `AggregateFunctionPtr`) is destroyed before the base class member `merged_data`, whose destructor then dereferences dangling pointers into the already-freed patterns. Fix by resetting `merged_data` in the derived destructor, ensuring `~GraphiteRollupMergedData` runs while `params` is still alive. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98204&sha=b003cfb861b70b7461035f2ac3d5438cffefdc24&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan%29 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
|
Workflow [PR], commit [bb3e34e] Summary: ❌
|
KochetovNicolai
approved these changes
Mar 6, 2026
Merged
via the queue into
ClickHouse:master
with commit Mar 6, 2026
66d5008
144 of 145 checks passed
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix heap-use-after-free in GraphiteRollupSortedAlgorithm
Documentation entry for user-facing changes
When an exception occurs during
mergeBlockwith aGraphiteMergeTreetable (e.g. fuzzed column types likeInt128for theTimecolumn), the aggregate state inGraphiteRollupMergedDatacan be left active. On destruction, the derived class memberparams(owning the patterns vector withAggregateFunctionPtr) is destroyed before the base class membermerged_data, whose destructor then dereferences dangling pointers into the already-freed patterns.Fix by resetting
merged_datain the derived destructor, ensuring~GraphiteRollupMergedDataruns whileparamsis still alive.ASan report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98204&sha=b003cfb861b70b7461035f2ac3d5438cffefdc24&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan%29
#98204
Closes #98523
Version info
26.3.1.482