RFR: 8352088: Call of com.sun.jdi.ThreadReference.threadGroups() can lock up target VM [v4]
Chris Plummer
cjplummer at openjdk.org
Thu Mar 27 15:30:16 UTC 2025
On Thu, 27 Mar 2025 11:07:31 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
>>
>> remove unused locals.
>
> src/java.base/share/classes/java/lang/ThreadGroup.java line 661:
>
>> 659: /**
>> 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.
>
> Can you say why briefly here? Because it's called during thread startup and may deadlock with ClassLoad events. I see the comment in the test but not sure if someone will find it, except through git blame, which might be enough.
I was trying to avoid getting too much into the weeds with the explanation. There's always that one extra bit of information that would be useful, but after adding that then there's another, and you need to decide when to stop. How about the following (and I really don't want to go any further than this):
* WARNING: Make sure this method does not trigger any class loading,
* because a ClassPrepareEvent can deadlock the debugger and debug agent.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24236#discussion_r2016941766
More information about the core-libs-dev
mailing list