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

Chris Plummer cjplummer at openjdk.org
Mon Mar 31 17:31:49 UTC 2025


On Sat, 29 Mar 2025 08:55:43 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> 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).

I'd rather not use "callback" here. Even the JVMTI spec mostly documents in terms of events, not callbacks. For example, for the ClassLoad callback it says "For most purposes the ClassPrepare event will be more useful". Maybe as a compromise I can change "ClassPrepareEvent" to "ClassPrepare event".

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

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


More information about the serviceability-dev mailing list