RFR: 8319935: Ensure only one JvmtiThreadState is created for one JavaThread associated with attached native thread [v5]

Jiangli Zhou jiangli at openjdk.org
Thu Nov 30 16:50:23 UTC 2023


On Wed, 29 Nov 2023 23:06:10 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

> A belated thumbs up. Sorry I didn't get back to this review before the fix was integrated.

Still thanks for reviewing the change, @dcubed-ojdk.

> 
> I found just a nit comment that could be more clear.

The particular issue occurred when `JavaThread::allocate_threadObj` was allocating and initializing the Thread instance. When the allocation of the Thread object triggered sampling, it could create a `JvmtiThreadState` with null thread oop with the bug. 

It seems "is being allocated" describes the issue more accurately.

> src/hotspot/share/prims/jvmtiExport.cpp line 3143:
> 
>> 3141: 
>> 3142:   // If the current thread is attaching from native and its Java thread object
>> 3143:   // is being allocated, things are not ready for allocation sampling.
> 
> nit - typo: s/is being allocated/has not been allocated/

Please see other comment.

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

PR Comment: https://git.openjdk.org/jdk/pull/16642#issuecomment-1834148374
PR Review Comment: https://git.openjdk.org/jdk/pull/16642#discussion_r1410956027


More information about the serviceability-dev mailing list