8004697: SIGSEGV on Solaris sparc with -XX:+UseNUMA
authorstefank
Mon, 11 Mar 2013 02:24:01 -0700
changeset 15955 6d0d8bea2bcc
parent 15954 fbcf5f5047c6
child 15956 309beb854960
child 15957 58302a2ffb9a
8004697: SIGSEGV on Solaris sparc with -XX:+UseNUMA Summary: Don't scan pages outside the given range. Reviewed-by: jwilhelm, jmasa
hotspot/src/os/solaris/vm/os_solaris.cpp
hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Tue Mar 12 09:42:24 2013 +0100
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Mon Mar 11 02:24:01 2013 -0700
@@ -2945,7 +2945,7 @@
   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++;
     }
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Tue Mar 12 09:42:24 2013 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Mon Mar 11 02:24:01 2013 -0700
@@ -948,6 +948,8 @@
       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);