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

Coleen Phillimore coleenp at openjdk.org
Thu Mar 27 11:15:09 UTC 2025


On Wed, 26 Mar 2025 20:50:36 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:
> 
>   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.

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

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


More information about the serviceability-dev mailing list