The test does not enforce a page-in before unmap, making the memory access check after unmap a no-op if page was load lazily.
That is, if lazy load is implemented correctly, the mmap call itself does NOT cause the PTE creation. Therefore, an immediately unmap call and checks afterward does NOT really check if the mapped region is inaccessible after unmap (because the PTE is never created, mapped region is never paged-in).
possible fix:
add
volatile int tmp UNUSED = *(int *) ACTUAL;
before unmap
This way, a page-in is enforced. Now, the unmap followed by a memory access check will actually check if proper clean up is performed.
The test does not enforce a page-in before unmap, making the memory access check after unmap a no-op if page was load lazily.
That is, if lazy load is implemented correctly, the
mmapcall itself does NOT cause the PTE creation. Therefore, an immediatelyunmapcall and checks afterward does NOT really check if the mapped region is inaccessible after unmap (because the PTE is never created, mapped region is never paged-in).possible fix:
add
before unmap
This way, a page-in is enforced. Now, the unmap followed by a memory access check will actually check if proper clean up is performed.