Open carey opened 3 years ago
OMG! That is a terrible bug :( -- I pushed a fix and will push out a new mimalloc release this week.
It turns out to be relatively benign as one would only observe it when (manually) reserving a huge arena (over 2GiB) and allocating a large allocations across the block boundaries. However, for the last few weeks I have been looking into a service that mysteriously leaks very slowly memory over weeks and I now think this bug may be the culprit. fingers crossed.
Thanks so much for spotting this! -- embarrassing error; I am now going over the code in detail again and see if there are other problems as well.
In
mi_bitmap_is_claimedx_across
, the middle fields and the post field all compare the field contents againstpre_mask
. Compared to the preceding functions, it looks like these should be usingmid_mask
andpost_mask
, respectively.I can’t say if this has caused any issues; I've just been reading the code to understand how the atomic operations work.