[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Integrated: 8292657: Calling GetLocalXXX from virtual thread with thread parameter set to NULL retur
From:       Serguei Spitsyn <sspitsyn () openjdk ! org>
Date:       2022-08-30 18:32:30
Message-ID: GebfhcBx1L6KWvHLEfePVGDWLsOUFAcof0pyjnZdA4k=.6ab41204-92de-4c85-82b9-d98b2bed82d2 () github ! com
[Download RAW message or body]

On Fri, 26 Aug 2022 20:13:28 GMT, Serguei Spitsyn <sspitsyn@openjdk.org> wrote:

> If JVM TI GetLocalXXX/SetLocalXXX is called from a virtual thread with the thread \
> parameter set to NULL (meaning current thread) then it should get/set the value of \
> the locals in the virtual thread frames. Instead, it reads the carrier thread \
> locals and/or crashes. 
> The fix is that the relevant checking of the jthread parameter for NULL and \
> adjusting it to current thread is added. It is done in new utility `function \
> current_thread_obj_or_resolve_external_guard(jthread thread)`. For more convenient \
> testing the same adjustment is done in the JVM TI extension function \
> `GetCarrierThread()`. 
> The test serviceability/jvmti/vthread/GetSetLocalTest is updated to add previously \
> missed test coverage. 
> The test serviceability/jvmti/vthread/VThreadTest has been updated to adopt to \
> update behavior of the `GetCarrierThread`. 
> The fix was verified with the test/hotspot/jtreg/serviceability/jvmti/vthread/ \
> tests. 
> The fix was also tested with the existing JVM TI and JDI tests to make sure no \
> regressions are introduced.

This pull request has now been integrated.

Changeset: f5ebbf32
Author:    Serguei Spitsyn <sspitsyn@openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/f5ebbf3225fc10367ef4e2b4ec62e9077565e6aa
                
Stats:     39 lines in 6 files changed: 24 ins; 2 del; 13 mod

8292657: Calling GetLocalXXX from virtual thread with thread parameter set to NULL \
returns carrier locals

Reviewed-by: cjplummer, alanb

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic