Skip to content

fix data race - #877

Merged
lemire merged 1 commit into
masterfrom
fix_datarace
Sep 8, 2026
Merged

lemire merged 1 commit into
masterfrom
fix_datarace

Conversation

@lemire

@lemire lemire commented Sep 8, 2026

Copy link
Copy Markdown
Member

There is a possible data race.

Fixes #876

@lemire
lemire merged commit 21ba444 into master Sep 8, 2026
37 checks passed
pull Bot pushed a commit to muzammilar/ClickHouse that referenced this pull request Sep 29, 2026
Upstream changes between `v5.1.1` and `v5.2.0`:

- Fix a data race in `shared_container_extract_copy`: it now uses the new
  `croaring_refcount_is_unique` helper instead of decrementing the refcount
  and racing with a concurrent reader, and it releases the shared container
  properly on the copy path (RoaringBitmap/CRoaring#877).
- Add set-cardinality methods (`and_cardinality`, `or_cardinality`,
  `andnot_cardinality`, `xor_cardinality`, `intersect`) to `Roaring64Map`
  (RoaringBitmap/CRoaring#875). Purely additive C++ API.
- Documentation updates and CI action bumps.

No ClickHouse-side adaptation is needed: the source file set is unchanged,
so `contrib/croaring-cmake/CMakeLists.txt` stays as is, and the C/C++ API
changes are additive.

Verified that `groupBitmapState` serialization and the bitmap functions
produce byte-identical results against the previous binary over
`UInt8`/`UInt16`/`UInt32`/`UInt64` and the signed types, including
cross-version deserialization of `AggregateFunction(groupBitmap, UInt32)`
states in both directions.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data race / use-after-free in shared_container_extract_copy

1 participant