Backport/stable 25.8/92588 - #2254
Open
VighneshPath wants to merge 3 commits into
Open
Conversation
… concurrent in-place mutations ColumnNullable::shrinkToFit() now also shrinks the null-map column wrapper, and MergeTreeReadTask::read() uses IColumn::mutate() instead of a use_count()==1 check before shrinking, cloning shared subcolumns first to avoid a double-free/UAF when shrinkToFit() runs concurrently on a shared column. The MergeTreeRangeReader.cpp hunk from the upstream PR is not included: this branch has no canInplaceFilter()/assumeMutable()->filter() fast path, so that particular crash vector doesn't exist here.
…ToFit crash Adds 03681_mergetree_shrink_const_nested_nullable, targeting the case where a constant inside PREWHERE, wrapped in materialize(toNullable(materialize(...))), produces a ColumnNullable with use_count() == 1 at the top level but a shared nested column underneath -- the case the old use_count()==1 guard in MergeTreeReadTask::read() missed. Verified: reverting the ClickHouse#92588 backport fix reproduces a SIGSEGV in jemalloc (eset_remove/extent_recycle) within seconds of running this test; with the fix in place, the test passes reliably.
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 to CHANGELOG.md):
Fix potential crash caused by in place mutation of underlying const PREWHERE columns. This could've happened at column shrinking (
IColumn::shrinkToFit) or filtering (IColumn::filter), which could've triggered concurrently from several threads. Backport of ClickHouse#92588.Documentation entry for user-facing changes
Fix potential crash caused by in place mutation of underlying const PREWHERE columns. This could've happened at column shrinking (
IColumn::shrinkToFit) or filtering (IColumn::filter), which could've triggered concurrently from several threads. Backport of ClickHouse#92588.CI/CD Options
Exclude tests:
Regression jobs to run: