Repository navigation
Resolve the 25.8 cherry-pick conflict of #112327 - #114814
Conversation
|
Workflow [BackportPR], commit [bbfad95] |
Internal second-model review (1 round, resolved) and validation detailGate B raised one major finding: reusing #112327's description here would promise master-only Validation, in full:
Build ids were asserted against the running server for every arm (fix The abort on pristine The other four automated backports (#114797 |
CI finish ledger - b1962e7CI is fully finished on this head: 32 leaves, 28
The failure is a Root cause is in the test: on Coverage on this head is real: 8567 stateless tests passed with 0 failures across the three Session id: cron:our-pr-ci-monitor:20260814-163000 |
|
@alexbakharew this is the 25.8 half of #112327, which you merged on master. 25.8 still has the bug on today's tip ( The robot could not carry 25.8 because Two things worth knowing. This PR carries no Could you review it, or point me at the right person? |
Backport of ClickHouse#112327 to 25.8. The robot cherry-pick (ClickHouse#114796) conflicts in src/Dictionaries/DictionaryHelpers.h because the materializing call in getColumnVectorData is removeSpecialRepresentations on master and recursiveRemoveSparse here; removeSpecialRepresentations does not exist on this branch. The resolution keeps 25.8's call and takes the fix's predicate, so the resolved change is the same 8 insertions and 7 deletions as the merged commit. 25.8 is affected. On the official 25.8.30.17 binary the amplified repro (a 2M-row sparse probe joined to a FLAT dictionary with join_algorithm = 'direct') segfaults in 2 of 7 runs, and with jemalloc junk filling it fails 4 of 4 with "Invalid number of rows in Chunk ... expected 65409, got 0". Writing the same data densely passes. A value comparison alone cannot see this: freed but intact memory still returns the right numbers, which is why both arms agreed until the freed page was poisoned. Verified in both directions with a clang-19 Debug build, 25.8's pinned compiler, build ids asserted against the running server. The pristine branch aborts on the first assertion of the ported test, at PODArray::operator[] inside FlatDictionary::hasKeys reached through IDictionary::getByKeys and DirectKeyValueJoin::joinBlock, which is the mechanism reported on master. With the fix the test passes and the repro returns the correct result 3 of 3 runs. The test carries one branch adaptation: enable_lazy_columns_replication does not exist on 25.8 and is rejected as an unknown setting, so it is dropped from the ARRAY JOIN statement. The statement and every assertion are kept. The comment drops ColumnReplicated from the carrier list because that class does not exist here. Co-Authored-By: Claude Opus 5 <[email protected]> The test comments describe what each statement asserts at the SQL level and no longer name C++ functions or classes, per the review of the master commit. The statements and the reference are unchanged: stripping comments from both revisions yields byte-identical SQL (md5 5a88d22c5d3f4aedbdeb8befef6c0ef9), and both format to the same AST.
b1962e7 to
bbfad95
Compare
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a use-after-free when a
LEFT JOINto a dictionary withjoin_algorithm = 'direct'had a join key that is serializedSparse.getColumnVectorDatareturned aPaddedPODArrayreference into a column owned only by a function-localColumnPtr, so the dictionary lookup read freed memory.Description
Backport of #112327 to
25.8. The robot cherry-pick #114796 isCONFLICTING, so the automation cannot carry it.The conflict is in one file.
getColumnVectorDatamaterializes its key column withremoveSpecialRepresentationson master and withrecursiveRemoveSparsehere;removeSpecialRepresentationsdoes not exist on this branch. The resolution keeps 25.8's call and takes the fix's predicate, so the resolved change is the same 8 insertions and 7 deletions as the merged commit. On this branch the copy therefore guardsConstandSparse;ColumnReplicateddoes not exist here and is dropped from the comment's carrier list.25.8is affected. On the official25.8.30.17binary the repro (a 2M-row sparse probe joined to aFLAT()dictionary) segfaults in 2 of 7 runs, and with jemalloc junk filling it fails 4 of 4 withInvalid number of rows in Chunk ... expected 65409, got 0. The same data written densely passes. Comparing returned values alone cannot see this, because freed but intact memory still yields the correct numbers.Verified in both directions with a clang-19 Debug build, this branch's pinned compiler, asserting build ids against the running server. Pristine
25.8aborts on the first assertion of the ported test, atPODArray::operator[]insideFlatDictionary::hasKeysreached throughIDictionary::getByKeysandDirectKeyValueJoin::joinBlock- the mechanism reported on master. With the fix the test passes and the repro returns the correct result in 3 of 3 runs.One branch adaptation in the test:
enable_lazy_columns_replicationdoes not exist on25.8and is rejected as an unknown setting, so it is dropped from theARRAY JOINstatement. The statement and every assertion are kept.