changeset 4540:bec5f1758368

8008357: [sampling] assert(sender_blob->is_runtime_stub() || sender_blob->is_nmethod()) failed: Impossible call chain Reviewed-by: coleenp, sla
author rbackman
date Thu, 28 Feb 2013 09:45:57 +0100
parents 5967e5c9c7f0
children a1b2802cb232
files src/cpu/sparc/vm/frame_sparc.cpp src/cpu/x86/vm/frame_x86.cpp
diffstat 2 files changed, 12 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/frame_sparc.cpp	Mon Mar 25 15:19:40 2013 +0100
+++ b/src/cpu/sparc/vm/frame_sparc.cpp	Thu Feb 28 09:45:57 2013 +0100
@@ -252,6 +252,11 @@
       return false;
     }
 
+    // Could be a zombie method
+    if (sender_blob->is_zombie() || sender_blob->is_unloaded()) {
+      return false;
+    }
+
     // It should be safe to construct the sender though it might not be valid
 
     frame sender(_SENDER_SP, younger_sp, adjusted_stack);
@@ -294,10 +299,10 @@
       return jcw_safe;
     }
 
-    // If the frame size is 0 something is bad because every nmethod has a non-zero frame size
+    // If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
     // because you must allocate window space
 
-    if (sender_blob->frame_size() == 0) {
+    if (sender_blob->frame_size() <= 0) {
       assert(!sender_blob->is_nmethod(), "should count return address at least");
       return false;
     }
--- a/src/cpu/x86/vm/frame_x86.cpp	Mon Mar 25 15:19:40 2013 +0100
+++ b/src/cpu/x86/vm/frame_x86.cpp	Thu Feb 28 09:45:57 2013 +0100
@@ -188,17 +188,7 @@
       return false;
     }
 
-    // Exception stubs don't make calls
-    if (sender_blob->is_exception_stub()) {
-      return false;
-    }
-
-    if (sender_blob->is_deoptimization_stub()) {
-        return false;
-    }
-
     // Could be the call_stub
-
     if (StubRoutines::returns_to_call_stub(sender_pc)) {
       intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset);
       bool saved_fp_safe = ((address)saved_fp < thread->stack_base()) && (saved_fp > sender_sp);
@@ -228,10 +218,10 @@
       }
     }
 
-    // If the frame size is 0 something is bad because every nmethod has a non-zero frame size
+    // If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
     // because the return address counts against the callee's frame.
 
-    if (sender_blob->frame_size() == 0) {
+    if (sender_blob->frame_size() <= 0) {
       assert(!sender_blob->is_nmethod(), "should count return address at least");
       return false;
     }
@@ -241,7 +231,9 @@
     // should not be anything but the call stub (already covered), the interpreter (already covered)
     // or an nmethod.
 
-    assert(sender_blob->is_runtime_stub() || sender_blob->is_nmethod(), "Impossible call chain");
+    if (!sender_blob->is_nmethod()) {
+        return false;
+    }
 
     // Could put some more validation for the potential non-interpreted sender
     // frame we'd create by calling sender if I could think of any. Wait for next crash in forte...