RoaringBitmap / RoaringBitmap/CRoaring

Roaring64 doesn't handle out of memory

Open
#630 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.9k
Forks
334
Avg merge
2d 5h
Merged PRs (30d)
17

Description

In the 32bit version of croaring the returned value of roaring_malloc() is checked and if it's NULL (the runtime cannot allocate more memory) then NULL is returned and we don't try to dereference that pointer.

In the 64bit version of croaring, the return value of roaring_malloc() is not checked: the code assumes that it can never return NULL. If it does, we'll definitely get a SIGSEGV due to dereferencing a NULL pointer.

What is the correct memory model we should be using here?

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

Compare the 32-bit and 64-bit allocation paths, starting with their handling of the return value from roaring_malloc(). Determine the intended memory model and define what should happen when allocation returns NULL, then verify that the 64-bit path no longer dereferences an unavailable allocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.