From d3be157fd5f94502e73dd2bda35653a4ea95248d Mon Sep 17 00:00:00 2001 From: Fredrik Bredberg Date: Mon, 16 Mar 2026 09:06:58 +0000 Subject: [PATCH] 8379457: Test EATests.java#id0 ERROR: monitor list errors: error_cnt=1 Reviewed-by: aartemov, aboldtch, dholmes --- src/hotspot/share/runtime/synchronizer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/synchronizer.cpp b/src/hotspot/share/runtime/synchronizer.cpp index 8ea5fe31145..e3293f94eeb 100644 --- a/src/hotspot/share/runtime/synchronizer.cpp +++ b/src/hotspot/share/runtime/synchronizer.cpp @@ -1416,7 +1416,11 @@ void ObjectSynchronizer::chk_in_use_entry(ObjectMonitor* n, outputStream* out, } const markWord mark = obj->mark(); - if (!mark.has_monitor()) { + // Note: When using ObjectMonitorTable we may observe an intermediate state, + // where the monitor is globally visible, but no thread has yet transitioned + // the markWord. To avoid reporting a false positive during this transition, we + // skip the `!mark.has_monitor()` test if we are using the ObjectMonitorTable. + if (!UseObjectMonitorTable && !mark.has_monitor()) { out->print_cr("ERROR: monitor=" INTPTR_FORMAT ": in-use monitor's " "object does not think it has a monitor: obj=" INTPTR_FORMAT ", mark=" INTPTR_FORMAT, p2i(n),