JDK-8323507 : assert(current->held_monitor_count() == 0) failed: Should not be possible
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2023-11-13
  • Updated: 2024-01-15
  • Resolved: 2024-01-10
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
# JRE version: OpenJDK Runtime Environment (22.0) (fastdebug build 22-internal-adhoc.jdk22u)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 22-internal-adhoc.jdk22u, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)

A DESCRIPTION OF THE PROBLEM :
I ran a modified regression test case on JDK22.0(mainline) and found that the JVM crashed without any options.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/repository/jdk22u/src/hotspot/share/runtime/synchronizer.cpp:1828), pid=59834, tid=59843
#  assert(current->held_monitor_count() == 0) failed: Should not be possible
#
# JRE version: OpenJDK Runtime Environment (22.0) (fastdebug build 22-internal-adhoc.jdk22u)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 22-internal-adhoc.jdk22u, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x3be3ee1]  ObjectSynchronizer::release_monitors_owned_by_thread(JavaThread*)+0x161
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
java compiler.arraycopy.TestNegativeArrayCopyAfterLoop

ACTUAL -
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/repository/jdk22u/src/hotspot/share/runtime/synchronizer.cpp:1828), pid=59834, tid=59843
#  assert(current->held_monitor_count() == 0) failed: Should not be possible
#
# JRE version: OpenJDK Runtime Environment (22.0) (fastdebug build 22-internal-adhoc.jdk22u)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 22-internal-adhoc.jdk22u, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x3be3ee1]  ObjectSynchronizer::release_monitors_owned_by_thread(JavaThread*)+0x161
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/repository/toreport/TestNegativeArrayCopyAfterLoop_11_13_09_04_00/hs_err_pid59834.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

---------- BEGIN SOURCE ----------
The source code file and hs_err file are available at the URL:
https://drive.google.com/file/d/14zcT6miCPDYNcqWC7cZ2GP-QvCCSnfYb/view?usp=drive_link
---------- END SOURCE ----------

FREQUENCY : always



Comments
Thanks Vladimir for checking and the confirmation!
15-01-2024

Yes, it is the same. The modified test has local synchronized object: // modified code: synchronized (new Double(1.1f)) { Object var1 = new test(); for (int var2 = 0; var2 < 10; ++var2) { if (var2 == 9) { var1 = new test(); } } }
10-01-2024

I'm closing this as a dup of JDK-8322743. [~kvn] can you verify and confirm this?
10-01-2024

Could be a duplicate of JDK-8322743.
08-01-2024

Why was this closed as fixed? And which JBS issue fixed this?
03-01-2024