RFR: 8332923: ObjectMonitorUsage.java failed with unexpected waiter_count

SendaoYan syan at openjdk.org
Sun May 26 14:27:01 UTC 2024


On Sun, 26 May 2024 11:26:50 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> That would mean it's not tested. I suspect the java_lang_VirtualThread::is_instance checks will need to be changed to test with is_a(vmClasses::BaseVirtualThread_klass()) to allow for the alternative implementation.

Do you mean change like this:

diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp
index 077b05f936e..c03bb511e2a 100644
--- a/src/hotspot/share/classfile/javaClasses.cpp
+++ b/src/hotspot/share/classfile/javaClasses.cpp
@@ -1971,7 +1971,7 @@ void java_lang_VirtualThread::compute_offsets() {
 }
 
 bool java_lang_VirtualThread::is_instance(oop obj) {
-  return obj != nullptr && is_subclass(obj->klass());
+  return obj != nullptr && obj->is_a(vmClasses::BaseVirtualThread_klass());
 }
 
 oop java_lang_VirtualThread::carrier_thread(oop vthread) {


This change will crash on linux x86_32 when run the testcase ObjectMonitorUsage.java.

# V  [libjvm.so+0x833af1]  JvmtiEnvBase::get_threadOop_and_JavaThread(ThreadsList*, _jobject*, JavaThread**, oopDesc**)+0x121


[hs_err_pid233589.log](https://github.com/openjdk/jdk/files/15447775/hs_err_pid233589.log)

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

PR Comment: https://git.openjdk.org/jdk/pull/19405#issuecomment-2132241354


More information about the serviceability-dev mailing list