RFR: 8306471: Add virtual threads support to JDWP ThreadReference.Stop and JDI ThreadReference.stop() [v8]
Chris Plummer
cjplummer at openjdk.org
Thu May 11 17:59:55 UTC 2023
> Note this PR depends on the #13546 PR for the following:
>
> [JDK-8306434](https://bugs.openjdk.org/browse/JDK-8306434): add support of virtual threads to JVMTI StopThread
>
> So it can't be finalized and push until after JDK-8306434 is pushed. There will also be GHA failures until then. If JDK-8306434 results in any additional spec changes, they will likely impact this CR also.
>
>
> [JDK-8306034](https://bugs.openjdk.org/browse/JDK-8306034) is adding some virtual thread support to JVMTI StopThread. This will allow JDWP ThreadReference.Stop and JDI ThreadReference.stop() to have the same level support for virtual threads.
>
> Mostly this is a spec update for JDWP and JDI, but there are also some minor changes needed to the ThreadReference.stop() handling of JDWP errors, and throwing the appropriate exceptions. Also some minor cleanup in jdb. The debug agent doesn't need changes since JVMTI errors are just passed through as the corresponding JDWP errors, and the code for this is already in place. These errors are not new nor need any special handling.
>
> Our existing testing for ThreadReference.stop() is fairly weak:
>
> - nsk/jdb/kill/kill001, which tests stop() when the thread is suspended at a breakpoint. It will get problem listed by [JDK-8306034](https://bugs.openjdk.org/browse/JDK-8306034). I have fixes for it already working and will push it separately.
> - nsk/jdi/stop/stop001, which is problem listed and only tests when the thread is blocked in Object.wait()
> - nsk/jdi/stop/stop002, which only tests that throwing an invalid exception fails properly
>
> I decided to take stop002 and make it a more thorough test of ThreadReference.stop(). See the comment at the top for a list of what is tested. As for reviewing this test, it's probably best to look at it as a completely new test rather than looking at diffs since so much has been changed and added.
Chris Plummer has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:
- Merge branch 'master' into 8306471_vthread_stop
merge with master
- clarify test #1 in the debuggee.
- fix minor comment typo
- fix minor comment typo
- Some test logging improvements.
- Don't rely in Thread.sleep() to sychronize between debugger and debuggee.
- Fix test when suspended in a loop. Cleanup sme comments.
- fix some jcheck whitespace errors
- minor formatting fixes
- minor JDWP spec wording change
- ... and 1 more: https://git.openjdk.org/jdk/compare/f93c7453...195abe20
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/13548/files
- new: https://git.openjdk.org/jdk/pull/13548/files/d9722d1c..195abe20
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=13548&range=07
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=13548&range=06-07
Stats: 178912 lines in 2784 files changed: 135263 ins; 23446 del; 20203 mod
Patch: https://git.openjdk.org/jdk/pull/13548.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/13548/head:pull/13548
PR: https://git.openjdk.org/jdk/pull/13548
More information about the serviceability-dev
mailing list