8166679: JNI AsyncGetCallTrace replaces topmost frame name with <no Java callstack recorded> starting with Java 9 b133
authorcjplummer
Mon, 24 Oct 2016 14:12:32 -0700
changeset 42051 0264f170da65
parent 42050 77c41d9c4253
child 42052 b3a1c6c4f86e
8166679: JNI AsyncGetCallTrace replaces topmost frame name with <no Java callstack recorded> starting with Java 9 b133 Summary: Partly undid the changes for 8159284, which are the cause of this CR. Reviewed-by: dholmes, coleenp, dcubed
hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp
hotspot/src/cpu/sparc/vm/frame_sparc.cpp
hotspot/src/cpu/x86/vm/frame_x86.cpp
--- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp	Mon Oct 24 11:48:30 2016 -0700
+++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp	Mon Oct 24 14:12:32 2016 -0700
@@ -204,8 +204,15 @@
       }
 
       // construct the potential sender
+
       frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
-      return sender.is_entry_frame_valid(thread);
+
+      // Validate the JavaCallWrapper an entry frame must have
+      address jcw = (address)sender.entry_frame_call_wrapper();
+
+      bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)sender.fp());
+
+      return jcw_safe;
     }
 
     CompiledMethod* nm = sender_blob->as_compiled_method_or_null();
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Mon Oct 24 11:48:30 2016 -0700
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Mon Oct 24 14:12:32 2016 -0700
@@ -279,7 +279,13 @@
     }
 
     if (sender.is_entry_frame()) {
-      return sender.is_entry_frame_valid(thread);
+      // Validate the JavaCallWrapper an entry frame must have
+
+      address jcw = (address)sender.entry_frame_call_wrapper();
+
+      bool jcw_safe = (jcw <= thread->stack_base()) && (jcw > sender_fp);
+
+      return jcw_safe;
     }
 
     // If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Mon Oct 24 11:48:30 2016 -0700
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Mon Oct 24 14:12:32 2016 -0700
@@ -203,8 +203,15 @@
       }
 
       // construct the potential sender
+
       frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
-      return sender.is_entry_frame_valid(thread);
+
+      // Validate the JavaCallWrapper an entry frame must have
+      address jcw = (address)sender.entry_frame_call_wrapper();
+
+      bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)sender.fp());
+
+      return jcw_safe;
     }
 
     CompiledMethod* nm = sender_blob->as_compiled_method_or_null();