> This problem has two sides.
> One is that the `VirtualThread::run() `cashes the field `notifyJvmtiEvents` 
> value.
> It caused the native method `notifyJvmtiUnmountBegin()` not called after the 
> field `notifyJvmtiEvents`
> value has been set to `true` when an agent library is loaded into running VM.
> The fix is to get rid of this cashing.
> Another is that enabling `notifyJvmtiEvents` notifications needs a 
> synchronization.
> Otherwise, a VTMS transition start can be missed which will cause some 
> asserts to fire.
> The fix is to use a JvmtiVTMSTransitionDisabler helper for sync.
> 
> Testing:
> The originally failed tests are passed now:
> 
> runtime/vthread/RedefineClass.java
> runtime/vthread/TestObjectAllocationSampleEvent.java 
> 
> In progress:
> Run the tiers 1-6 to make sure there are no regression.

Serguei Spitsyn has updated the pull request incrementally with one additional 
commit since the last revision:

  remove caching if notifyJvmtiEvents in yieldContinuation

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11304/files
  - new: https://git.openjdk.org/jdk/pull/11304/files/c0d2f0ef..6608b1a6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11304&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11304&range=00-01

  Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/11304.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11304/head:pull/11304

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

Reply via email to