You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deserializing a bitmap, it is possible that the result might be invalid. This could happen because there was data corruption. The deserialization could still generate a bitmap without failure, but the result could be otherwise unusable.
You can avoid such problems by hashing your saved data (e.g., md5sum). But we could could also directly, at some expense, validate the deserialized data.
The C version of Roaring has an interesting function that can be called after deserializing a bitmap, to make sure it is proper:
I have written the validation according to C version of Roaring bitmaps. Some checks were removed, e.g. it is impossible to have negative capacity as it is derived from array length, which is always positive.
One TODO left - is it somehow possible to have run container with nbrruns equal to zero?
Do you have some suggestion how to create broken serialized bitmap to make some tests?
When deserializing a bitmap, it is possible that the result might be invalid. This could happen because there was data corruption. The deserialization could still generate a bitmap without failure, but the result could be otherwise unusable.
You can avoid such problems by hashing your saved data (e.g., md5sum). But we could could also directly, at some expense, validate the deserialized data.
The C version of Roaring has an interesting function that can be called after deserializing a bitmap, to make sure it is proper:
https://github.com/RoaringBitmap/CRoaring/blob/a103d3811702b9389c538881c9974e9a7a7552af/src/roaring.c#L435
It is not very difficult to implement and could help users who have production data.
The text was updated successfully, but these errors were encountered: