On Mon, 20 Jul 2026 03:39:54 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). > > David CARLIER has updated the pull request incrementally with one additional > commit since the last revision: > > Skip SetLocal sub-tests on virtual threads @devnexen Your change (at version 8b92c680a262426379a5c66e337c77f1292bf961) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/31965#issuecomment-5018673958
