The debug agent uses a lot of different JVMTI raw monitor. It's very easy to get a deadlock if they are entered in the wrong order. I recently ran across a deadlock where this was happening. There currently is no checking to make sure that raw monitor are entered in the proper order.
All of the debug agent raw monitor should be given a rank, and asserts added to make sure that raw monitor are entered in the order of their rank. This will help detect potential deadlocks. The debug agent already has wrapper functions for the JVMTI raw monitor APIs. The rank bookkeeping and asserts can be added there.
All of the debug agent raw monitor should be given a rank, and asserts added to make sure that raw monitor are entered in the order of their rank. This will help detect potential deadlocks. The debug agent already has wrapper functions for the JVMTI raw monitor APIs. The rank bookkeeping and asserts can be added there.
- blocks
-
JDK-8331747 Use shared getThreadName() API in debug agent, and fix lack of local ref freeing
- Open
- relates to
-
JDK-8332738 Debug agent can deadlock on callbackLock when using StackFrame.PopFrames
- Resolved
-
JDK-8330193 JDWP getLocks() should make sure current thread doesn't grab any more locks
- Open
-
JDK-8338708 Don't create/destroy debug agent cmdQueueLock for each connection
- Resolved
- links to
-
Review(master) openjdk/jdk/19044