8379457: Test EATests.java#id0 ERROR: monitor list errors: error_cnt=1

Reviewed-by: aartemov, aboldtch, dholmes
This commit is contained in:
Fredrik Bredberg 2026-03-16 09:06:58 +00:00
parent c04fe765a3
commit d3be157fd5

View File

@ -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),