pmem / kvdk

Key Value Development Kit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PMEMAllocator does not correctly populate PMEM space

tthebst opened this issue · comments

Populate space sometimes fails to initialize the pmem space. In PMEMAllocator::PopulateSpace it is possible that pmem_memset gets called on memory that is not part of the file. It happens if pu (cpu count) is not a power of 2. In my case pu was 12 and I used linux memmap. This caused a segmentation fault.

Reproduce:

Solutions:

  • Always set pu to 16 as done here and check file is the power of 2
  • Handle edge case for cases where cpu count not power of two

Thanks for submitting, problem resolved #51