changeset 58405:59b5bd9a7168

8241043: Expand assertions to identify thread with errant _stack_base Reviewed-by: mikael
author dholmes
date Mon, 16 Mar 2020 02:16:49 -0400
parents 981b5a0c43da
children 4eaf6922273a
files src/hotspot/share/runtime/thread.cpp src/hotspot/share/runtime/thread.hpp
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/runtime/thread.cpp	Mon Mar 16 10:51:01 2020 +0800
+++ b/src/hotspot/share/runtime/thread.cpp	Mon Mar 16 02:16:49 2020 -0400
@@ -349,6 +349,7 @@
   // If possible, refrain from doing anything which may crash or assert since
   // quite probably those crash dumps will be useless.
   set_stack_base(os::current_stack_base());
+  assert(_stack_base != NULL, "current_stack_base failed for %s", name());
   set_stack_size(os::current_stack_size());
 
 #ifdef SOLARIS
--- a/src/hotspot/share/runtime/thread.hpp	Mon Mar 16 10:51:01 2020 +0800
+++ b/src/hotspot/share/runtime/thread.hpp	Mon Mar 16 02:16:49 2020 -0400
@@ -748,7 +748,7 @@
 
  public:
   // Stack overflow support
-  address stack_base() const           { assert(_stack_base != NULL,"Sanity check"); return _stack_base; }
+  address stack_base() const           { assert(_stack_base != NULL,"Sanity check failed for %s", name()); return _stack_base; }
   void    set_stack_base(address base) { _stack_base = base; }
   size_t  stack_size() const           { return _stack_size; }
   void    set_stack_size(size_t size)  { _stack_size = size; }