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

Possible deadlock involving JfrSamplerThread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 26
    • hotspot
    • jfr
    • aarch64
    • os_x

      An execution of our Runthese8H stress application encountered a timeout. As part of the timeout handling a core dump of the process was taken. That core dump shows that the VMThread is trying to initiate a safepoint but can't get the Threads_lock. Other threads are also blocked trying to acquire the Threads_lock for thread start/remove and other checks. Yet more threads are blocked trying to submit further VM operations. The owner of the Threads_lock is here:

      thread #43
          frame #0: 0x000000018d150cc0 libsystem_kernel.dylib`__sigsuspend + 8
          frame #1: 0x0000000105c0302c libjvm.dylib`SR_handler(int, __siginfo*, void*) + 308
          frame #2: 0x000000018d1bade4 libsystem_platform.dylib`_sigtramp + 56
          frame #3: 0x000000018d185a00 libsystem_pthread.dylib`_pthread_create + 996
          frame #4: 0x0000000105aa095c libjvm.dylib`os::create_thread(Thread*, os::ThreadType, unsigned long) + 312
          frame #5: 0x00000001054e15cc libjvm.dylib`JavaThread::JavaThread(void (*)(JavaThread*, JavaThread*), unsigned long, MemTag) + 68
          frame #6: 0x0000000105642844 libjvm.dylib`JVM_StartThread + 1136

      and it appears this thread is being suspended by the JfrSamplerThread and is waiting to be resumed. Here is the JfrSamplerThread:

      thread #65
          frame #0: 0x000000018d150d9c libsystem_kernel.dylib`__ulock_wait2 + 8
          frame #1: 0x000000018d1b8aac libsystem_platform.dylib`_os_unfair_lock_lock_slow + 180
          frame #2: 0x000000018d183ee8 libsystem_pthread.dylib`pthread_kill + 152
          frame #3: 0x0000000105c02584 libjvm.dylib`PosixSignals::do_resume(OSThread*) + 116
          frame #4: 0x0000000105c026d0 libjvm.dylib`SuspendedThreadTask::internal_do_task() + 80
          frame #5: 0x0000000105575994 libjvm.dylib`JfrSamplerThread::sample_java_thread(JavaThread*) + 76
          frame #6: 0x00000001055756f8 libjvm.dylib`JfrSamplerThread::task_stacktrace(JfrSampleRequestType, JavaThread**) + 332
          frame #7: 0x0000000105575580 libjvm.dylib`JfrSamplerThread::run() + 300
          frame #8: 0x0000000105d34dbc libjvm.dylib`Thread::call_run() + 240
          frame #9: 0x0000000105aa0ef8 libjvm.dylib`thread_native_entry(Thread*) + 312
          frame #10: 0x000000018d1842e4 libsystem_pthread.dylib`_pthread_start + 136

      It is trying to resume the target thread but for some reason is blocking at the OS level within pthread_kill.

            Unassigned Unassigned
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: