RFR: 8306034: add support of virtual threads to JVMTI StopThread [v7]

Serguei Spitsyn sspitsyn at openjdk.org
Tue May 2 01:23:22 UTC 2023


> This enhancement adds support of virtual threads to the JVMTI `StopThread` function.
> In preview releases before this enhancement the StopThread returned the JVMTI_ERROR_UNSUPPORTED_OPERATION error code for virtual threads.
> 
> The `StopThread` supports sending an asynchronous exception to a virtual thread only if it is current or suspended at mounted state. For instance, a virtual thread can be suspended at a JVMTI event. If the virtual thread is not suspended and is not current then the `JVMTI_ERROR_THREAD_NOT_SUSPENDED` error code is returned. If the virtual thread was suspended at unmounted state then the `JVMTI_ERROR_OPAQUE_FRAME` error code is returned.
> 
> The `StopThread` has the following description for `JVMTI_ERROR_OPAQUE_FRAME` error code:
>> The thread is a suspended virtual thread and the implementation 
>> was unable to throw an asynchronous exception from this frame.
> 
> A couple of the `serviceability/jvmti/vthread` tests has been updated to adopt to new `StopThread` behavior.
> 
> The CSR is: https://bugs.openjdk.org/browse/JDK-8306434
> 
> Testing:
> The mach5 tears 1-6 are in progress.
> Preliminary test runs were good in general.
> The JDB test `vmTestbase/nsk/jdb/kill/kill001/kill001.java` has been problem-listed and will be fixed by the corresponding debugger enhancement which is going to adopt JDWP/JDI specs to new behavior of the JVMTI `StopThread` related to virtual threads.
> 
> Also, two JCK JVMTI tests are failing in the tier-6 :
>> vm/jvmti/StopThread/stop001/stop00103/stop00103.html
>> vm/jvmti/StopThread/stop001/stop00103/stop00103a.html
> 
> These two tests will be excluded from the test runs by the JCK team and then adjusted to new `StopThread` behavior.

Serguei Spitsyn 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 eight additional commits since the last revision:

 - Merge
 - install_async_exception: set interrupt status for platform threads only
 - minor tweak in new test
 - 1. Address review comments 2. Clear interrupt bit in the TestTaskThread
 - corrections for BoundVirtualThread and test typos
 - addressed review comments on new test
 - fixed trailing spaces
 - 8306034: add support of virtual threads to JVMTI StopThread

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/13546/files
  - new: https://git.openjdk.org/jdk/pull/13546/files/0113f034..50e615eb

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13546&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13546&range=05-06

  Stats: 58946 lines in 964 files changed: 40128 ins; 12285 del; 6533 mod
  Patch: https://git.openjdk.org/jdk/pull/13546.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13546/head:pull/13546

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


More information about the hotspot-dev mailing list