JDK-8308978 : regression with a deadlock involving FollowReferences
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 21
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2023-05-26
  • Updated: 2023-07-02
  • Resolved: 2023-06-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b26Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8308986 :  
Description
Integration of the following enhancement triggered/introduced new failure mode with a deadlock:
JDK-8299414: JVMTI FollowReferences should support references from VirtualThread stack

This thread is (stuck?) in transition:

debugee.stdout> [516.812s][error][jvmti] ForkJoinPool-1-worker-4(ForkJoinPool-1-worker-4) exiting: 0 is_susp: 0 is_thread_susp: 0 is_vthread_susp: 0 is_VTMS_transition_disabler: 0, is_in_VTMS_transition = 1
debugee.stdout> 
debugee.stdout> [516.812s][error][jvmti]   java.lang.Thread java.lang.Thread.currentCarrierThread():-1
debugee.stdout> [516.812s][error][jvmti]   void java.lang.VirtualThread.mount():353
debugee.stdout> [516.812s][error][jvmti]   boolean java.lang.VirtualThread.yieldContinuation():444
debugee.stdout> [516.812s][error][jvmti]   void java.lang.VirtualThread.park():592
debugee.stdout> [516.812s][error][jvmti]   void java.lang.System$2.parkVirtualThread():2649
debugee.stdout> [516.812s][error][jvmti]   void jdk.internal.misc.VirtualThreads.park():54
debugee.stdout> [516.812s][error][jvmti]   void java.util.concurrent.locks.LockSupport.park():369
debugee.stdout> [516.812s][error][jvmti]   void sun.nio.ch.Poller.poll2(int, long, java.util.function.BooleanSupplier):139
debugee.stdout> [516.812s][error][jvmti]   void sun.nio.ch.Poller.poll(int, long, java.util.function.BooleanSupplier):102
debugee.stdout> [516.812s][error][jvmti]   void sun.nio.ch.Poller.poll(int, int, long, java.util.function.BooleanSupplier):87
debugee.stdout> [516.812s][error][jvmti]   void sun.nio.ch.NioSocketImpl.park(java.io.FileDescriptor, int, long):175
debugee.stdout> [516.812s][error][jvmti]   void sun.nio.ch.NioSocketImpl.park(java.io.FileDescriptor, int):201
debugee.stdout> [516.812s][error][jvmti]   int sun.nio.ch.NioSocketImpl.implRead(byte[], int, int):309
debugee.stdout> [516.812s][error][jvmti]   int sun.nio.ch.NioSocketImpl.read(byte[], int, int):346
debugee.stdout> [516.812s][error][jvmti]   int sun.nio.ch.NioSocketImpl$1.read(byte[], int, int):796
debugee.stdout> [516.812s][error][jvmti]   int java.net.Socket$SocketInputStream.read(byte[], int, int):1099
debugee.stdout> [516.812s][error][jvmti]   int java.net.Socket$SocketInputStream.read():1093
debugee.stdout> [516.812s][error][jvmti]   int java.io.ObjectInputStream$PeekInputStream.peek():2893
debugee.stdout> [516.812s][error][jvmti]   int java.io.ObjectInputStream$BlockDataInputStream.peek():3220
debugee.stdout> [516.812s][error][jvmti]   byte java.io.ObjectInputStream$BlockDataInputStream.peekByte():3230
debugee.stdout> [516.812s][error][jvmti]   java.lang.Object java.io.ObjectInputStream.readObject0(java.lang.Class, boolean):1713
debugee.stdout> [516.812s][error][jvmti]   java.lang.Object java.io.ObjectInputStream.readObject(java.lang.Class):540
debugee.stdout> [516.812s][error][jvmti]   java.lang.Object java.io.ObjectInputStream.readObject():498
debugee.stdout> [516.812s][error][jvmti]   java.lang.Object nsk.share.jpda.SocketConnection.doReadObject():581
debugee.stdout> [516.812s][error][jvmti]   java.lang.Object nsk.share.jpda.SocketConnection.readObject():518
debugee.stdout> [516.812s][error][jvmti]   java.lang.String nsk.share.jpda.SocketIOPipe.readln():193
debugee.stdout> [516.812s][error][jvmti]   void nsk.share.jpda.AbstractDebuggeeTest.doTest():309


This thread is waiting for the thread in transition to disable VTMS transitions:

Current thread (0x0000ffff8c339cc0):  JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=3016377, stack(0x0000ffff65600000,0x0000ffff65800000) (2048K)]

Stack: [0x0000ffff65600000,0x0000ffff65800000],  sp=0x0000ffff657fe130,  free space=2040k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x10a20b0]  JvmtiVTMSTransitionDisabler::VTMS_transition_disable_for_all()+0x210  (jvmtiThreadState.cpp:358)
V  [libjvm.so+0x10929bc]  JvmtiTagMap::follow_references(int, Klass*, _jobject*, jvmtiHeapCallbacks const*, void const*)+0x16c  (jvmtiTagMap.cpp:3030)
V  [libjvm.so+0x103ae00]  JvmtiEnv::FollowReferences(int, _jclass*, _jobject*, jvmtiHeapCallbacks const*, void const*)+0x1f0  (jvmtiEnv.cpp:2105)
V  [libjvm.so+0xfe5d78]  jvmti_FollowReferences+0x118  (jvmtiEnter.cpp:1715)
C  [libjdwp.so+0x31464]  classInstances+0xb0  (util.c:2548)
C  [libjdwp.so+0x8648]  instances+0x98  (ReferenceTypeImpl.c:272)
C  [libjdwp.so+0x13c64]  debugLoop_run+0x2b4  (debugLoop.c:162)
C  [libjdwp.so+0x290e4]  attachThread+0x54  (transport.c:392)
V  [libjvm.so+0x1071d84]  JvmtiAgentThread::call_start_function()+0xc4  (jvmtiImpl.cpp:89)
V  [libjvm.so+0xda870c]  JavaThread::thread_main_inner()+0xec  (javaThread.cpp:719)
V  [libjvm.so+0x15f7054]  Thread::call_run()+0xb0  (thread.cpp:217)
V  [libjvm.so+0x1353b80]  thread_native_entry(Thread*)+0x130  (os_linux.cpp:775)
C  [libpthread.so.0+0x7908]  start_thread+0x188
Comments
Changeset: 62c935d4 Author: Alex Menkov <amenkov@openjdk.org> Date: 2023-06-02 22:02:04 +0000 URL: https://git.openjdk.org/jdk/commit/62c935d4fa09ed557d301bc28d9bf1480b344989
02-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14233 Date: 2023-05-30 22:58:58 +0000
30-05-2023

Bumping from P3 -> P2 since this is a regression and there is not a specific ILW analysis justifying a P3.
30-05-2023