RFR(s): 8247248: JVM TI might create JNI locals in another thread when using handshakes.

Robbin Ehn robbin.ehn at oracle.com
Wed Jun 10 07:56:12 UTC 2020


Hi Serguei, thanks!

Yes I'll add a comments.

Thanks, Robbin

On 2020-06-09 20:30, serguei.spitsyn at oracle.com wrote:
> Hi Robbin,
> 
> Nice catch!
> The fix looks good in general.
> I'd be nice to add comments to explain why these global refs are created.
> 
> 
> Thanks,
> Serguei
> 
> 
> On 6/9/20 09:15, Robbin Ehn wrote:
>> Hi all,
>>
>> If the direct handshake is executed by the target thread, the JNI
>> local(s) are created in that thread but returned in the handshaking
>> thread.
>> They thus are not safe to use. (thread might even have exited by this
>> point)
>>
>> Code:
>> http://cr.openjdk.java.net/~rehn/8247248/v1/webrev/
>>
>> Unfortunately there is no way the distinguish a local jobject vs a
>> global. Which makes it hard to track when the jobject is global and not.
>>
>> Issue:
>> https://bugs.openjdk.java.net/browse/JDK-8247248
>>
>> Local testing of JDI/JVMTI and t1-5.
>> (no real crash so there is nothing to reproduce)
>>
>> Thanks, Robbin
> 


More information about the serviceability-dev mailing list