urcs-sync / ralloc

Recoverable lock-free allocator based on LRMalloc
MIT License
45 stars 9 forks source link

Bugs in restart execution when /dev/shm is used #12

Open qtcwt opened 4 years ago

qtcwt commented 4 years ago

When /dev/shm is used (i.e., SHM_SIMULATING is defined), at the end of a restart execution when cached blocks are given back to their superblocks, the superblock pointer in their descriptor is NULL.

It could be due to incorrect write-back, or there's something missed for restart. It shouldn't be due to page caching of mmap whose backing file is in /dev/shm, since explicitly issuing a msync before munmap doesn't solve the issue. However, the issue disappears when /mnt/pmem and DAX-mmap is used.

The branch of test has a toy program that can trigger this bug.

Also, another bug was reported that RP_free causes a segfault in a similar scenario---in a restart execution with SHM_SIMULATING, and disappears when /mnt/pmem is used.

qtcwt commented 4 years ago

Both bugs are triggered despite the proper call to RP_close at the end of the previous execution.