-
- Downloads
Fix bug in leak detection interaction with mmap() code
mmu::allocate(), implementing mmap(), used to first evacuate the region (marking it free), then allocate a tiny vma object (a start,end pair), and finally populate the region. But it turns out that the allocation, if it calls backtrace() for the first time, ends up calling mmap() too :-) These two running mmap()s aren't protected by the mutex (it's the same thread), and the second mmap could take the region just freed by the first mmap - before returning to the first mmap who would reuse this region. We solve this bug by allocating the vma object before evacuating the region, so the other mmap picks different memory. Before this fix, "--leak tests/tst-mmap.so" crashes with assertion failure. With this fix, it succeeds.
Please register or sign in to comment