RFR: 8284402: serviceability/jvmti/events/MonitorContendedEntered/mcontent…

Serguei Spitsyn sspitsyn at openjdk.java.net
Mon Apr 25 02:57:19 UTC 2022


The following tests fail in Loom:
  serviceability/jvmti/events/MonitorContendedEnter/mcontenter01
  serviceability/jvmti/events/MonitorContendedEntered/mcontentered01
  serviceability/jvmti/events/MonitorWait/monitorwait01
  serviceability/jvmti/events/MonitorWaited/monitorwaited01

with the error:

# Internal Error (/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14747/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4ceff4c0-ff1e-4329-9c88-90f77211fe28/runs/480df0be-42f1-45f1-add5-989e159fadb3/workspace/open/src/hotspot/share/runtime/jniHandles.inline.hpp:64), pid=15533, tid=15535
# assert(external_guard || result != __null) failed: Invalid JNI handle 


The problem is that the agent thread has this code without synchronization:
-  jni->DeleteGlobalRef(expected_object);
-  jni->DeleteGlobalRef(expected_thread);

So, the expected_object and expected_thread can be destroyed when an event callback is still executed.
The simplest way to fix it to remove this fragment.
Also, these Loom tests were originated/converted from the nsk.jvmti tests which do not have this fragment.

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

Commit messages:
 - 8284402: serviceability/jvmti/events/MonitorContendedEntered/mcontentered01/mcontentered01.java fail in repo-loom

Changes: https://git.openjdk.java.net/loom/pull/165/files
 Webrev: https://webrevs.openjdk.java.net/?repo=loom&pr=165&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8284402
  Stats: 15 lines in 4 files changed: 0 ins; 15 del; 0 mod
  Patch: https://git.openjdk.java.net/loom/pull/165.diff
  Fetch: git fetch https://git.openjdk.java.net/loom pull/165/head:pull/165

PR: https://git.openjdk.java.net/loom/pull/165


More information about the loom-dev mailing list