RFR: 8338714: vmTestbase/nsk/jdb/kill/kill001/kill001.java fails with JTREG_TEST_THREAD_FACTORY=Virtual.

Chris Plummer cjplummer at openjdk.org
Fri Dec 6 22:32:46 UTC 2024


This test fails after [JDK-8338713](https://bugs.openjdk.org/browse/JDK-8338713) when using JTREG_TEST_THREAD_FACTORY=Virtual. The test uses JVMTI StopThread on a thread expecting it to be mounted. Before [JDK-8338713](https://bugs.openjdk.org/browse/JDK-8338713) it would be mounted because it was blocked on a syncrhonized, which resulted in the thread being pinned. After [JDK-8338713](https://bugs.openjdk.org/browse/JDK-8338713) this is no longer the case and the virtual thread has unmounted. This causes JVMTI StopThread to fail with JVMTI_ERROR_OPAQUE_FRAME because it only supports mounted virtual threads.

Fixed by using the VThreadPinner class to make sure the virtual threads remains pinned, and therefore mounted.

Testing:

- [x] Ran jdb tests locally in both virtual thread mode and platform thread mode.
- [ ] tier1
- [ ] tier2 svc
- [ ] tier5 svc

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

Commit messages:
 - Use VThreadPinner to make sure virtual threads are mounted when StopThread is called.

Changes: https://git.openjdk.org/jdk/pull/22620/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22620&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8338714
  Stats: 26 lines in 3 files changed: 15 ins; 9 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/22620.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22620/head:pull/22620

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


More information about the serviceability-dev mailing list