RoaringBitmap / RoaringBitmap/roaring-rs

`roaring::RoaringBitmap::full().statistics()` panics if overflow checks are enabled

Open Beginner friendly
#357 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
957
Forks
119
Avg merge
3d 3h
Merged PRs (30d)
1

Description

thread 'main' (3828616) panicked at roaring-0.11.4/src/bitmap/statistics.rs:92:21

This points at
https://github.com/RoaringBitmap/roaring-rs/blob/83caaca2ec5ea29e27dc19f930b9450b9a246b5b/roaring/src/bitmap/statistics.rs#L92

The cardinality of the bitmap is exactly 232 (across 216 run containers), so it blows up when collecting the last container as it needs to store a value above u32::MAX.

Probably not a big issue, but it was a bit surprising to hit that first thing when trying to compare RoaringBitmap::new() and RoaringBitmap::full().

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at roaring/src/bitmap/statistics.rs:92 and reproduce the panic with RoaringBitmap::full().statistics() while overflow checks are enabled. Trace how the final run container contributes to the cardinality, then verify that statistics handles the exact 2^32-cardinality bitmap without panicking.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.