Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't check if the memory is in core (#64)
libunwind uses mincore() to validate that memory is mapped and available to the process.
For this purpose, checking the return value of mincore() is sufficient.
The result array tells us if the kernel has swapped out the page or not.
We don't care about this, and the check leads to failure in those
cases where the kernel has swapped out the page.
  • Loading branch information
ShutterQuick authored and Dave Watson committed Feb 9, 2018
1 parent 7d6cc66 commit 05d814b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/x86_64/Ginit.c
Expand Up @@ -140,11 +140,6 @@ static int mincore_validate (void *addr, size_t len)
return -1;
}

for (i = 0; i < (len + PAGE_SIZE - 1) / PAGE_SIZE; i++)
{
if (!(mvec[i] & 1)) return -1;
}

return write_validate (addr);
}
#endif
Expand All @@ -165,7 +160,7 @@ tdep_init_mem_validate (void)
int ret;
while ((ret = mincore ((void*)addr, PAGE_SIZE, mvec)) == -1 &&
errno == EAGAIN) {}
if (ret == 0 && (mvec[0] & 1))
if (ret == 0)
{
Debug(1, "using mincore to validate memory\n");
mem_validate_func = mincore_validate;
Expand Down

0 comments on commit 05d814b

Please sign in to comment.