VM bugfix & regression test
The bug in the offset correction code for the 'shrink region from below' case can easily case an assert(foundregion->offset == offset) to trigger (if the blocks are touched afterwards, e.g. on fork()) as the offsets become wrong. This commit is a fix & regression test. Change-Id: I28ed403e3891362a2dea674a49e786d3450d2983
This commit is contained in:
committed by
Gerrit Code Review
parent
502bc37a61
commit
274fdff60c
@@ -75,6 +75,21 @@ readblock(int b, int blocksize, u32_t seed, char *data)
|
||||
|
||||
void testend(void) { }
|
||||
|
||||
void basic_regression(void)
|
||||
{
|
||||
void *block;
|
||||
#define BLOCKSIZE (PAGE_SIZE*10)
|
||||
block = minix_mmap(0, BLOCKSIZE, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
|
||||
if(block == MAP_FAILED) { e(1); exit(1); }
|
||||
|
||||
memset(block, 0, BLOCKSIZE);
|
||||
|
||||
/* shrink from bottom */
|
||||
minix_munmap(block, PAGE_SIZE);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@@ -82,6 +97,8 @@ main(int argc, char *argv[])
|
||||
|
||||
start(74);
|
||||
|
||||
basic_regression();
|
||||
|
||||
makefiles(MAXFILES);
|
||||
|
||||
cachequiet(!bigflag);
|
||||
|
||||
Reference in New Issue
Block a user