Skip to content
Snippets Groups Projects
Commit ed2a70f1 authored by Glauber Costa's avatar Glauber Costa Committed by Pekka Enberg
Browse files

tests: enhance mmap test


We have recently discovered a bug through which we fail to unmap a valid region.
This is fixed now, and this patch adds the failing condition to the test suite.

Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent a4999feb
No related branches found
No related tags found
No related merge requests found
......@@ -283,6 +283,13 @@ int main(int argc, char **argv)
assert(mincore(align_page_down(y)+1, 1, vec) == -1);
free(y);
// If we are able to map a smaller-than-a-page region (that will be
// obviously aligned internally), we should be able to unmap using the same
// size.
void *small = mmap(NULL, 64, PROT_READ, MAP_ANON | MAP_PRIVATE, -1, 0);
assert(small != nullptr);
assert(munmap(small, 64) == 0);
// TODO: verify that mmapping more than available physical memory doesn't
// panic just return -1 and ENOMEM.
// TODO: verify that huge-page-sized allocations get a huge-page aligned address
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment