ProcessInfo::blockInMemory(char *start) does not appropriately account for a block of memory. The following logic disregards where the address was within the page:
start = start - ( (unsigned long long)start % pageSize );
While it may be unlikely we would need to call this function with an unaligned address, it could cause unexpected results when an unaligned start address is passed in. Additionally, this function only checks a single page (128 bytes, which gets rounded up to the next page boundry), although ranges are supported by mincore() on Linux and Darwin. Perhaps it's worth adding an optional length parameter and ensuring support for memory that spans multiple pages?
- is related to
-
SERVER-3635 for non in mem yielding, touch / check whole record not just beginning
- Closed
-
SERVER-3711 Record::touch with entireRecord true need to check bounds of mapped region
- Closed