RoaringBitmap / RoaringBitmap/CRoaring
Error reporting should be better
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.9k
- Forks
- 334
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 17
Description
Currently error handling is poor:
- failure to allocate memory results in error message sent to stderr and segfault (e.g. in
roaring_bitmap_add()) - there is no way to distinguish between memory allocation errors and serialization format errors (
portable_deserialize())
Both problems can be solved with integer error codes, e.g. 0 -- operation successful, -1 -- memory allocation error, -2 -- serialization format error, etc. Error codes should be returned for all operations which modify bitmaps.
There is, of course, an issue of atomicity. If error occurs inside some modification operation, bitmap can enter half-broken state. Atomicity guarantee would be too expensive from performance perspective. But we need to at least guarantee that bitmaps can be safely roaring_bitmap_free()d, even after an error. All other operations are UB.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining roaring_bitmap_add() and portable_deserialize(), then identify the other operations that modify bitmaps. Define integer error-code behavior for allocation and serialization failures, including the guarantee that roaring_bitmap_free() remains safe after an error. The issue explicitly permits non-atomic mutations, so document the resulting usage constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100