8004697: SIGSEGV on Solaris sparc with -XX:+UseNUMA

Don't scan pages outside the given range.

Reviewed-by: jwilhelm, jmasa
This commit is contained in:
Stefan Karlsson 2013-03-11 02:24:01 -07:00
parent 1aa6c27298
commit 1e1174e0be
2 changed files with 3 additions and 1 deletions

View File

@ -2945,7 +2945,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info
while (p < (uint64_t)end) {
addrs[0] = p;
size_t addrs_count = 1;
while (addrs_count < MAX_MEMINFO_CNT && addrs[addrs_count - 1] < (uint64_t)end) {
while (addrs_count < MAX_MEMINFO_CNT && addrs[addrs_count - 1] + page_size < (uint64_t)end) {
addrs[addrs_count] = addrs[addrs_count - 1] + page_size;
addrs_count++;
}

View File

@ -948,6 +948,8 @@ void MutableNUMASpace::LGRPSpace::scan_pages(size_t page_size, size_t page_count
break;
}
if (e != scan_end) {
assert(e < scan_end, err_msg("e: " PTR_FORMAT " scan_end: " PTR_FORMAT, e, scan_end));
if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id())
&& page_expected.size != 0) {
os::free_memory(s, pointer_delta(e, s, sizeof(char)), page_size);