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

[TESTBUG] serviceability/HeapDump/UnmountedVThreadNativeMethodAtTop.java deadlocks on exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 26
    • 24, 25, 26
    • hotspot
    • svc
    • master
    • generic
    • generic

      The test case VThreadBlockedAtOjectWait of serviceability/HeapDump/UnmountedVThreadNativeMethodAtTop.java can deadlock if the verifyHeapDump() call at

      https://github.com/openjdk/jdk/blob/63e08d4af7145b94048d565f4f80dae221090c19/test/hotspot/jtreg/serviceability/HeapDump/UnmountedVThreadNativeMethodAtTop.java#L111

      throws an exception and control is transferred to the finally block. There the join() at

      https://github.com/openjdk/jdk/blob/63e08d4af7145b94048d565f4f80dae221090c19/test/hotspot/jtreg/serviceability/HeapDump/UnmountedVThreadNativeMethodAtTop.java#L117

      produces a deadlock because the notify() above was not executed and the test runs into timeout.

      Typical symptom: stdout log does not include "1 virtual thread(s) found" from that location:
      https://github.com/openjdk/jdk/blob/63e08d4af7145b94048d565f4f80dae221090c19/test/hotspot/jtreg/serviceability/HeapDump/UnmountedVThreadNativeMethodAtTop.java#L144

      Typical stack when deadlocked (main thread blocked in join at UnmountedVThreadNativeMethodAtTop.java:117):

      "MainThread" #43 [37752] prio=5 os_prio=0 cpu=75006.62ms elapsed=720.12s tid=0x00007fffa028aaf0 nid=37752 waiting on condition [0x00007fff46ff9000]
         java.lang.Thread.State: WAITING (parking)
      at jdk.internal.misc.Unsafe.park(java.base@25-internal/Native Method)
      - parking to wait for <0x00000000fff00020> (a java.util.concurrent.CountDownLatch$Sync)
      at java.util.concurrent.locks.LockSupport.park(java.base@25-internal/LockSupport.java:223)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@25-internal/AbstractQueuedSynchronizer.java:789)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@25-internal/AbstractQueuedSynchronizer.java:1138)
      at java.util.concurrent.CountDownLatch.await(java.base@25-internal/CountDownLatch.java:230)
      at java.lang.VirtualThread.joinNanos(java.base@25-internal/VirtualThread.java:1002)
      at java.lang.Thread.join(java.base@25-internal/Thread.java:1843)
      at java.lang.Thread.join(java.base@25-internal/Thread.java:1936)
      at UnmountedVThreadNativeMethodAtTop.VThreadBlockedAtOjectWait(UnmountedVThreadNativeMethodAtTop.java:117)
      at java.lang.invoke.LambdaForm$DMH/0x00000177010a4800.invokeVirtual(java.base@25-internal/LambdaForm$DMH)
      at java.lang.invoke.LambdaForm$MH/0x00000177010a8000.invoke(java.base@25-internal/LambdaForm$MH)

            rrich Richard Reingruber
            rrich Richard Reingruber
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: