RFR: 8338714: vmTestbase/nsk/jdb/kill/kill001/kill001.java fails with JTREG_TEST_THREAD_FACTORY=Virtual.
Alan Bateman
alanb at openjdk.org
Sat Dec 7 07:36:37 UTC 2024
On Fri, 6 Dec 2024 22:28:29 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
> 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
test/hotspot/jtreg/vmTestbase/nsk/jdb/kill/kill001/kill001a.java line 166:
> 164: }
> 165:
> 166: public void run1() {
It might be a bit clear to rename run1 to runPinned (avoids run and run1).
test/hotspot/jtreg/vmTestbase/nsk/share/jdb/Launcher.java line 142:
> 140: /* Some jdb tests need java.library.path setup for native libraries. */
> 141: String libpath = System.getProperty("java.library.path");
> 142: args.add("-R-Djava.library.path=" + libpath);
Good, I wasn't sure how this inherit.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22620#discussion_r1874351813
PR Review Comment: https://git.openjdk.org/jdk/pull/22620#discussion_r1874351861
More information about the serviceability-dev
mailing list