> Currently kill001 assumes that JVMTI StopThread (via JDI > ThreadReference.stop) is not supported for virtual threads. > [JDK-8306034](https://bugs.openjdk.org/browse/JDK-8306034) is adding support > for StopThread on a virtual thread as long as it is suspended and mounted. > This means, for example, it will work for virtual threads in the following > conditions: > - Debuggee in a loop and suspended > - Debuggee blocked on a java monitor and suspended (because it is mounted > when blocked) > - Debuggee at a breakpoint and suspended > > But will continue to not work in the following situations: > - Debuggee in a loop but not suspended > - Debuggee blocked on a java monitor and not suspended > - Debuggee suspended but unmounted, such as during a call the Thread.sleep() > > kill001 suspends all threads when a breakpoint is hit in the main thread, and > then does a "jdb kill" on each thread, which translate to > `ThreadReference.stop()`. Si this is expected to work now since the > additional threads are all blocked on a java monitor, and therefore mounted > (and the breakpoint also suspended them). > > Most of the changes involve undoing the virtual thread specific code that was > added to the test as part of > [JDK-8282385](https://bugs.openjdk.org/browse/JDK-8282385). However, there is > an additional issue that also needs fixing. The test relies on the fact that > the async exception is normally not caught, and that jdb normally stops when > an uncaught exception is thrown. With virtual threads there ends up being an > exception handler in `java.lang.VirtualThread.run()`, resulting in jdb not > stopping when the async exception is thrown. This is fixed by having the test > issue a jdb "catch all <classname>" command for each async exception type > that the test throws.
Chris Plummer has updated the pull request incrementally with two additional commits since the last revision: - fix typo in comment - fix typo in comment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/13967/files - new: https://git.openjdk.org/jdk/pull/13967/files/c321c8e8..78f7a8ce Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=13967&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13967&range=03-04 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/13967.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/13967/head:pull/13967 PR: https://git.openjdk.org/jdk/pull/13967