ComputationalRadiationPhysics/mallocMC — pull request #62 by slizzered (2014-07-31 11:34:20+00:00)
Title: Bugfix: bitmask in PTE wrong (racecondition)

idea of how the bug worked (in hierarchical pages):
- currently selected onpagemask is not full.
- thread starts searching for free slot
- new free slots appear where the thread already searched, while the free slots in unvisited places disappear
- thread does not find a free slot, sets `_ptes[page].bitmask` at position of the onpagemask to 1, indicating that the onpagemask/segment is completely filled.
- since `_ptes[page].bitmask` indicates, that the onpagemask/segment is completely filled, no other threads will ever enter this segment.
- The bug hits, since the `_ptes[page].bitmask` on position onpagemask is only set to 0 by a thread that had a completely filled onpagemask and removes 1 element. Since the onpagemask was never completely filled, no thread will perform the reset
- memory is lost.