changeset 11850:f7fab4512ba1

8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent Summary: Stackwalking from corrupt frame Reviewed-by: dlong, thartmann
author neliasso
date Mon, 15 Aug 2016 16:04:16 +0200
parents 031f53ef620a
children 19ff411141d1
files src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed Aug 17 06:23:04 2016 +0000
+++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Mon Aug 15 16:04:16 2016 +0200
@@ -274,8 +274,14 @@
       // stack overflow handling
       return false;
     } else {
-      *fr = os::fetch_frame_from_ucontext(thread, uc);
-      *fr = frame(fr->sender_sp(), fr->sp());
+      // Returned frame will be the caller of the method that faults on the stack bang.
+      // Register window not yet rotated (happens at SAVE after stack bang), so there is no new
+      // frame to go with the faulting PC. Using caller SP that is still in SP, and caller PC
+      // that was written to O7 at call.
+      intptr_t* sp = os::Solaris::ucontext_get_sp(uc);
+      address pc = (address)uc->uc_mcontext.gregs[REG_O7];
+      *fr = frame(sp, frame::unpatchable, pc);
+
       if (!fr->is_java_frame()) {
         assert(fr->safe_for_sender(thread), "Safety check");
         *fr = fr->java_sender();