1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2025-01-24 17:20:30 +01:00

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.
This commit is contained in:
ShutterQuick 2018-02-09 16:41:54 +01:00 committed by Dave Watson
parent 7d6cc6696a
commit 05d814b640

View file

@ -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
@ -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;