On Sun, 19 Jul 2026 22:18:16 GMT, David CARLIER <[email protected]> wrote:

> The test added in JDK-8387718 (#31772) fails when run with the virtual thread 
> factory, on Linux and Windows, x64 and aarch64.
> 
> The failure is in the test's expectation, not in the VM. GetLocalLong/Double 
> with slot == INT_MAX still return JVMTI_ERROR_INVALID_SLOT as expected. But 
> SetLocalLong/Double return JVMTI_ERROR_OPAQUE_FRAME on a mounted virtual 
> thread: the runner() frame is inside a continuation, and 
> VM_BaseGetOrSetLocal::doit() rejects a set at depth != 0 in a continuation 
> frame before the slot bounds check is ever reached. On a platform thread 
> there is no continuation, so the set reaches the slot check and returns 
> INVALID_SLOT like the get accessors.
> 
> Since the set accessors cannot reach the overflow check on a virtual thread, 
> the test skips the set sub-tests there rather than asserting a second error 
> code. The Java side passes Thread.currentThread().isVirtual() to the agent, 
> which runs GetLocalLong/Double in both modes and adds SetLocalLong/Double 
> only on a platform thread. Every accessor that runs still requires 
> INVALID_SLOT, so the original overflow is exercised on platform threads and 
> the get path covers it on virtual threads.
> 
> Testing:
> 
> - [x] serviceability/jvmti/GetLocalVariable/GetSetLocalSlotOverflow.java 
> passes on platform threads (all four accessors return INVALID_SLOT)
> - [x] Passes with -testThreadFactory:Virtual (get accessors return 
> INVALID_SLOT, set skipped), reproducing then clearing the reported failure
> - [x] linux-x86_64 fastdebug
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: ffd46e01
Author:    David CARLIER <[email protected]>
Committer: Chris Plummer <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/ffd46e01a6ee075768badfcf27755719585616e0
Stats:     21 lines in 2 files changed: 12 ins; 0 del; 9 mod

8388464: New test 
serviceability/jvmti/GetLocalVariable/GetSetLocalSlotOverflow.java is failing 
with virtual threads

Reviewed-by: cjplummer, dholmes

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

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

Reply via email to