RoaringBitmap / roaring

Roaring bitmaps in Go (golang), used by InfluxDB, Bleve, DataDog
http://roaringbitmap.org/
Apache License 2.0
2.46k stars 227 forks source link

Fault When Creating Frozen Bitmap From MMapped #363

Open jacksonrnewhouse opened 2 years ago

jacksonrnewhouse commented 2 years ago

We have been trying to use Frozen Bitmaps for our internal system and were met with unanticipated faults. After working with @a392n328 we were able to write up this minimal failure, which is in #362. The actual error is

=== RUN   TestFrozenCases
unexpected fault address 0x15fb008
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0x15fb008 pc=0x11ed56a]

I can't figure out what exactly could be causing this.

lemire commented 2 years ago

Though it may well work, I should point out that we have no tests where we mutate the result of a FrozenView. My assumption has always been that the result of a FrozenView was to be considered immutable (frozen). You are treating frozen views as mutable... but we have no test that I can see that check that this is ok.

The frozen format was definitively created for immutable bitmaps. The idea was that you have something on disk that you just want to access (not modify). It may well be that our Go implementation supports mutations... but I'd like to see more tests.

lemire commented 2 years ago

A SIGBUS would suggest a buffer overflow.