Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8175342

assert(InstanceKlass::cast(k)->is_initialized()) failed: need to increase java_thread_min_stack_allowed calculation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      team

      Description

      I saw this just once, on arm, during testing of a clean JDK10 repo:

      # Internal Error (/scratch/opt/jprt/T/P1/215921.cplummer/s/hotspot/src/share/vm/utilities/exceptions.cpp:230), pid=72834, tid=72835
      # assert(InstanceKlass::cast(k)->is_initialized()) failed: need to increase java_thread_min_stack_allowed calculation

      --------------- T H R E A D ---------------

      Current thread (0x0000ffffa0019800): JavaThread "Unknown thread" [_thread_in_vm, id=72835, stack(0x0000ffffa6590000,0x0000ffffa65c0000)]

      Stack: [0x0000ffffa6590000,0x0000ffffa65c0000], sp=0x0000ffffa65bdbe0, free space=182k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xff26e4] VMError::report_and_die(int, char const*, char const*, std::__va_list, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x140;; VMError::report_and_die(int, char const*, char const*, std::__va_list, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x140
      V [libjvm.so+0xff32ec] VMError::report_and_die(Thread*, char const*, int, char const*, char const*, std::__va_list)+0x54;; VMError::report_and_die(Thread*, char const*, int, char const*, char const*, std::__va_list)+0x54
      V [libjvm.so+0x6a4e08] report_vm_error(char const*, int, char const*, char const*, ...)+0xe0;; report_vm_error(char const*, int, char const*, char const*, ...)+0xe0
      V [libjvm.so+0x751858] Exceptions::throw_stack_overflow_exception(Thread*, char const*, int, methodHandle const&)+0x344;; Exceptions::throw_stack_overflow_exception(Thread*, char const*, int, methodHandle const&)+0x344
      V [libjvm.so+0x947cdc] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2c4;; JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2c4
      V [libjvm.so+0xd31bd8] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*), JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x20;; os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*), JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x20
      V [libjvm.so+0x903868] InstanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*)+0x19c;; InstanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*)+0x19c
      V [libjvm.so+0x903a4c] InstanceKlass::call_class_initializer(Thread*)+0x90;; InstanceKlass::call_class_initializer(Thread*)+0x90
      V [libjvm.so+0x903dc8] InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x360;; InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x360
      V [libjvm.so+0x90420c] InstanceKlass::initialize(Thread*)+0xec;; InstanceKlass::initialize(Thread*)+0xec
      V [libjvm.so+0x903bb0] InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x148;; InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x148
      V [libjvm.so+0x90420c] InstanceKlass::initialize(Thread*)+0xec;; InstanceKlass::initialize(Thread*)+0xec
      V [libjvm.so+0xf5dab4] initialize_class(Symbol*, Thread*)+0x44;; initialize_class(Symbol*, Thread*)+0x44
      V [libjvm.so+0xf691dc] Threads::initialize_java_lang_classes(JavaThread*, Thread*)+0x80;; Threads::initialize_java_lang_classes(JavaThread*, Thread*)+0x80
      V [libjvm.so+0xf6b794] Threads::create_vm(JavaVMInitArgs*, bool*)+0x428;; Threads::create_vm(JavaVMInitArgs*, bool*)+0x428
      V [libjvm.so+0xa0ed98] JNI_CreateJavaVM+0xb8;; JNI_CreateJavaVM+0xb8
      C [libjli.so+0x6b04] JavaMain+0x80;; JavaMain+0x80
      C [libpthread.so.0+0x7e2c] start_thread+0xb0
      C [libc.so.6+0xc8c40] clone+0x70

        Issue Links

          Activity

          Hide
          dholmes David Holmes added a comment -
          Chris: yes as I was explaining we add the guard size to the requested stack so that when glibc steals it back we have what we originally wanted.

          Looking at JDK-8169373 only non-JavaThreads have the fix applied to them as only they should be having a glibc guard page set. So it seems to me the correct fix here is for the launcher to also not request a guard page as the thread it creates will be a JavaThread.
          Show
          dholmes David Holmes added a comment - Chris: yes as I was explaining we add the guard size to the requested stack so that when glibc steals it back we have what we originally wanted. Looking at JDK-8169373 only non-JavaThreads have the fix applied to them as only they should be having a glibc guard page set. So it seems to me the correct fix here is for the launcher to also not request a guard page as the thread it creates will be a JavaThread.
          Hide
          cjplummer Chris Plummer added a comment -
          So you are saying rather than having the launcher add the default guard page size to the stack size, it should instead call pthread_attr_setguardsize() to set the guard size to 0. I'll give this a try.
          Show
          cjplummer Chris Plummer added a comment - So you are saying rather than having the launcher add the default guard page size to the stack size, it should instead call pthread_attr_setguardsize() to set the guard size to 0. I'll give this a try.
          Hide
          dholmes David Holmes added a comment -
          Yes - the same as what happens when we create a JavaThread in the VM.
          Show
          dholmes David Holmes added a comment - Yes - the same as what happens when we create a JavaThread in the VM.
          Hide
          cjplummer Chris Plummer added a comment -
          Sigh, found a 3rd bug, but at least this time it's a test bug. Only shows up after this fix for this CR is in place. Created JDK-8176797.
          Show
          cjplummer Chris Plummer added a comment - Sigh, found a 3rd bug, but at least this time it's a test bug. Only shows up after this fix for this CR is in place. Created JDK-8176797 .
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk10/hs/jdk/rev/6bbc00cfa79c
          User: cjplummer
          Date: 2017-03-17 23:40:03 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk10/hs/jdk/rev/6bbc00cfa79c User: cjplummer Date: 2017-03-17 23:40:03 +0000

            People

            • Assignee:
              cjplummer Chris Plummer
              Reporter:
              cjplummer Chris Plummer
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: