RFR: 8352088: Call of com.sun.jdi.ThreadReference.threadGroups() can lock up target VM [v6]

Alan Bateman alanb at openjdk.org
Sat Mar 29 08:58:11 UTC 2025


On Fri, 28 Mar 2025 21:02:21 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Calling ThreadGroupReference.groups() from an event handler can cause a deadlock. Details in first comment. Tested with :jdk_lang on all supported platforms and tier1, tier2, tier3, and tier5 svc testing.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   undo change that wasn't suppose to be committed.

src/java.base/share/classes/java/lang/ThreadGroup.java line 662:

> 660:      * Returns a snapshot of the subgroups as an array, used by JVMTI.
> 661:      * WARNING: Make sure this method does not trigger any class loading,
> 662:      * because a ClassPrepareEvent can deadlock the debugger and debug agent.

The comment is okay but if you are doing any further edits then you could change this to say that a callback for the ClassPrepare event can deadlock (the event is "ClassPrepare" in the JVM TI spec, I realize the "ClassPrepareEvent" may have come from JDI).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24236#discussion_r2019756430


More information about the core-libs-dev mailing list