RFR: 8296492: Remove ObjectLocker in JVMTI get_subgroups call [v5]

Serguei Spitsyn sspitsyn at openjdk.org
Wed Nov 9 11:58:32 UTC 2022


On Wed, 9 Nov 2022 09:49:10 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> src/hotspot/share/prims/jvmtiEnvBase.cpp line 557:
>> 
>>> 555: JvmtiEnvBase::new_jthreadGroupArray(int length, objArrayHandle groups) {
>>> 556:   if (length == 0) {
>>> 557:     return NULL;
>> 
>> I do not think returning NULL is allowed for JVMTI `GetThreadGroupChildren()`.
>> Please, see: [GetThreadGroupChildren](https://docs.oracle.com/en/java/javase/19/docs/specs/jvmti.html#GetThreadGroupChildren)
>
> I don't think this has changed. Right now, if there are no child subgroups then *group_count_ptr will be 0 and *groups_ptr will be NULL as there is no memory to deallocate. JVMTI Deallocate is specified to do nothing when called with NULL.

Alan, you are right. This check existed before.

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

PR: https://git.openjdk.org/jdk/pull/11033


More information about the serviceability-dev mailing list