Repository navigation
Reject repeated paths in a serialized value of JSON in aggregate states - #131791
Conversation
…ates A value of a `JSON` column in an aggregate state (for example of `groupArray`) is deserialized by `ColumnObject::deserializeDynamicPathsAndSharedDataFromArena`, which accepted a path repeated within a row. A repeated dynamic path got several values for one row, so the column of the path became longer than the `JSON` column, and functions using it (`getNumberOfDefaultRows`, for example) read and wrote out of bounds. Reject a repeated dynamic path and shared-data paths that are not strictly increasing with `INCORRECT_DATA`, the way they are serialized, and check that subcolumns have the size of the column in `ColumnObject::getNumberOfDefaultRows`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [c65f88b] Summary: ❌
AI ReviewSummaryReviewed PR #131791 at Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 13 s compile time in total, 7 of them have a recent master baseline. |
Address review: `deserializeAndInsertFromArena` inserts typed paths before `deserializeDynamicPathsAndSharedDataFromArena`, so a name of a typed path repeated in the dynamic part passed both checks and got a second value in a new dynamic path or in shared data. Reject it with `INCORRECT_DATA` and add both cases to the test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 @groeneai, investigate the failure of The |
|
Acknowledged. I'm investigating the |
|
The fix is #132139 (test-only). Both failures (AsyncInsert and ParallelReplicas jobs) have one cause: the randomized |
|
🕵 Thanks, @groeneai — #132139 covers the flaky |
The second section asserts the exact `SelectedRows` quota charge (108) of a distributed `INSERT` whose materialized view on the remote server reads `dim_05409` (100 rows) through `remote`. CI got 116 and 110 on two PRs, both in `arm_binary ... s3 storage, parallel` jobs. The randomized `merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability` is forwarded with the `INSERT` to the remote servers. When the coin fires on a read with more than one stream, `ReadFromMergeTree::spreadMarkRangesAmongStreams` splits the ranges into layers with `splitPartsWithRangesByPrimaryKey`, and the granule on a layer border is read by both pipes (the PK-boundary filter drops the duplicates, so the result is right). `SelectedRows` counts that granule twice: +8 at `index_granularity` 8 (116), +2 at `index_granularity` 1 (110). A 100-row part gets several streams on object storage, where the concurrent-read thresholds are 0, which is why only the s3 jobs failed. Clamp the injection to 0 for this test with the runner's per-setting limit, the same header as 05508 (ClickHouse#129987). Every other setting stays randomized. Related: ClickHouse#131791 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Upgrade check was fixed in #132081 |
Cherry pick #131791 to 26.3: Reject repeated paths in a serialized value of `JSON` in aggregate states
… of `JSON` in aggregate states
Backport #131791 to 26.10: Reject repeated paths in a serialized value of `JSON` in aggregate states
Backport #131791 to 26.9: Reject repeated paths in a serialized value of `JSON` in aggregate states
Backport #131791 to 26.3: Reject repeated paths in a serialized value of `JSON` in aggregate states
Backport #131791 to 26.8: Reject repeated paths in a serialized value of `JSON` in aggregate states
Closes: #132739
A value of a
JSONcolumn in an aggregate state (for example ofgroupArray) is deserialized byColumnObject::deserializeDynamicPathsAndSharedDataFromArena, which accepted a path repeated within a row. A repeated dynamic path got several values for one row, so the column of the path became longer than theJSONcolumn, and functions using it (getNumberOfDefaultRows, for example) read and wrote out of bounds. Reject a repeated dynamic path and shared-data paths that are not strictly increasing withINCORRECT_DATA, the way they are serialized, and check that subcolumns have the size of the column inColumnObject::getNumberOfDefaultRows.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix out-of-bounds memory access with an aggregate state containing a
JSONvalue with a repeated path. Now such a state is rejected withINCORRECT_DATA.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/131791]
Version info
26.11.1.2877-master(included in26.11and later)26.10.8.31,26.9.34.11,26.8.42.18,26.3.67.30