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

JvmtiThreadState::state_for_while_locked() returns nullptr for an attached JNI thread with a java.lang.Thread object after JDK-8319935

    XMLWordPrintable

Details

    • 22
    • b27
    • x86_64, aarch64
    • os_x

    Description

      Failure happens with an internal stress test.

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/0db9c48f-6638-40d0-9a4b-bd9cc7533eb8-S29378/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a638f2ca-785f-4750-b275-1ab5ebbcc980/runs/8423732b-6dd3-4839-bcbd-4913acb4d193/workspace/open/src/hotspot/share/prims/jvmtiExport.cpp:2966), pid=6067, tid=259
      # guarantee(state != nullptr) failed: exiting thread called setup_jvmti_thread_state
      #
      # JRE version: Java(TM) SE Runtime Environment (22.0+26) (fastdebug build 22-ea+26-2112)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 22-ea+26-2112, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
      # Core dump will be written. Default location: core.6067
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #


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

      Current thread (0x00000001269d3010): JavaThread "AppKit Thread" [_thread_in_vm, id=259, stack(0x000000016f450000,0x000000016fc4c000) (8176K)]

      Stack: [0x000000016f450000,0x000000016fc4c000], sp=0x000000016fc47140, free space=8156k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x1121d3c] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x564 (jvmtiExport.cpp:2966)
      V [libjvm.dylib+0x112255c] VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*)+0x0
      V [libjvm.dylib+0x559588] print_error_for_unit_test(char const*, char const*, char*)+0x0
      V [libjvm.dylib+0xbb6248] JvmtiEventCollector::setup_jvmti_thread_state()+0x130
      V [libjvm.dylib+0xbb6ba4] JvmtiVMObjectAllocEventCollector::JvmtiVMObjectAllocEventCollector()+0x48
      V [libjvm.dylib+0x9e5564] JVM_GetStackAccessControlContext+0x170
      j java.security.AccessController.getStackAccessControlContext()Ljava/security/AccessControlContext;+0 java.base@22-ea
      j java.security.AccessController.getContext()Ljava/security/AccessControlContext;+0 java.base@22-ea
      j java.lang.Thread.<init>(Ljava/lang/ThreadGroup;Ljava/lang/String;ILjava/lang/Runnable;JLjava/security/AccessControlContext;)V+226 java.base@22-ea
      j java.lang.Thread.<init>(Ljava/lang/ThreadGroup;Ljava/lang/String;)V+10 java.base@22-ea
      v ~StubRoutines::call_stub 0x00000001133c4190
      V [libjvm.dylib+0x87bbac] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x420
      V [libjvm.dylib+0x87ad78] JavaCalls::call_special(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x118
      V [libjvm.dylib+0x87b05c] JavaCalls::call_special(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Handle, Handle, JavaThread*)+0x7c
      V [libjvm.dylib+0x8afa80] JavaThread::allocate_threadObj(Handle, char const*, bool, JavaThread*)+0x39c
      V [libjvm.dylib+0x98cad0] attach_current_thread(JavaVM_*, void**, void*, bool)+0x43c
      C [libosxapp.dylib+0x4ce4] +[ThreadUtilities getJNIEnv]+0xc4
      C [libawt_lwawt.dylib+0x63fe0] setUpAWTAppKit+0xe4
      C [libawt_lwawt.dylib+0x63d2c] +[AWTStarter starter:headless:]+0x54
      C [libosxapp.dylib+0x4dc8] +[ThreadUtilities invokeBlockCopy:]+0x1c
      C [Foundation+0x84914] __NSThreadPerformPerform+0xd4
      C [CoreFoundation+0x84c5c] __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__+0x1c
      C [CoreFoundation+0x84ba8] __CFRunLoopDoSource0+0xd0
      C [CoreFoundation+0x84894] __CFRunLoopDoSources0+0x10c
      C [CoreFoundation+0x83208] __CFRunLoopRun+0x334
      C [CoreFoundation+0x82734] CFRunLoopRunSpecific+0x258
      C [libjli.dylib+0xcdb0] CreateExecutionEnvironment+0x194
      C [libjli.dylib+0x8dfc] JLI_Launch+0x498
      C [java+0x3bbc] main+0x184

      The failing logic seems to think the thread is exiting when in fact it is attaching.

      Attachments

        Issue Links

          Activity

            People

              dcubed Daniel Daugherty
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: