RFR: 8297286: runtime/vthread tests crashing after JDK-8296324 [v17]

Serguei Spitsyn sspitsyn at openjdk.org
Mon Apr 3 21:57:46 UTC 2023


> The fix is to enable virtual threads support for late binding JVMTI agents.
> The fix includes:
> - New function `JvmtiEnvBase::enable_virtual_threads_notify_jvmti()` which does enabling JVMTI VTMS transition notifications in case of agent loaded into running VM. This function executes a VM operation counting VTMS transition bits in all `JavaThread`'s to correctly set the static counter `_VTMS_transition_count` needed for VTMS transition protocol.
> - New function `JvmtiEnvBase::disable_virtual_threads_notify_jvmti()` which is needed for testing. It is used by the `WhiteBox` API.
> - New WhiteBox function `WB_SetVirtualThreadsNotifyJvmtiMode(JNIEnv* env, jobject wb, jboolean enable)` needed for testing of this update.
> - New regression test: `serviceability/jvmti/vthread/ToggleNotifyJvmtiTest`
> 
> Testing:
> - New test: `serviceability/jvmti/vthread/ToggleNotifyJvmtiTest`
> - The originally failed tests are expected to pass 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 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 20 additional commits since the last revision:

 - Merge
 - set java_lang_Thread::is_in_VTMS_transition bit when notifyJvmti is off
 - minor simplification in ToggleNotifyJvmtiTest.java
 - review: addressed next round of review suggestions
 - review: tweak in count_transitions_and_correct_jvmti_thread_states
 - review: minor tweak in test
 - one more review round fixes
 - refactored jt->jvmti_thread_state() corrections in VM_SetNotifyJvmtiEventsMode
 - review: updated correction of jt->jvmti_thread_state() links in VM_SetNotifyJvmtiEventsMode
 - fixed trailing spaces in two files
 - ... and 10 more: https://git.openjdk.org/jdk/compare/5c31a0bf...b5624011

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/13133/files
  - new: https://git.openjdk.org/jdk/pull/13133/files/d38e53fd..b5624011

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13133&range=16
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13133&range=15-16

  Stats: 27373 lines in 728 files changed: 13694 ins; 9290 del; 4389 mod
  Patch: https://git.openjdk.org/jdk/pull/13133.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13133/head:pull/13133

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


More information about the serviceability-dev mailing list