JDK-8323685 : PrintSystemDictionaryAtExit has mutex rank assert
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-01-12
  • Updated: 2024-04-30
  • Resolved: 2024-01-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21 JDK 22 JDK 23
21.0.4-oracleFixed 22.0.2Fixed 23 b07Fixed
Related Reports
Relates :  
Description
The change for JDK-8317440 lowered the rank of the ConcurrentHashtableResize_lock, but now it's lower than tty.  This makes PrintSystemDictionaryAtExit assert with:

#  Internal Error (/scratch/cphillim/hg/jdk-linkage/open/src/hotspot/share/runtime/mutex.cpp:447), pid=2821830, tid=2821831
#  assert(false) failed: Attempting to acquire lock tty_lock/tty out of order with lock ConcurrentHashTableResize_lock/service-1 -- possible deadlock

At the time of JDK-8317440 we discussed having each CHT have their own resize lock ranking specified on construction.  We should have done that.
Comments
jdk22u fix request: Reason: this fixes a rare lock rank checker failure with the code root remembered set lock and the tty locker. Risk: low, change applies cleanly, running in mainline for some time now, and the JDK 21 backport also did not give any issue. There is a regression test.
23-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk22u/pull/162 Date: 2024-04-23 11:04:10 +0000
23-04-2024

Okay, will do.
23-04-2024

[~tschatzl] - can a jdk22u port also be completed ?
23-04-2024

Fix request [21u] I backport this for parity with 21.0.4-oracle. Required follow-up of JDK-8315503/JDK-8317440. Clean backport. SAP nightly testing passed.
10-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/477 Date: 2024-04-08 20:36:49 +0000
08-04-2024

Changeset: 2865afe7 Author: Coleen Phillimore <coleenp@openjdk.org> Date: 2024-01-19 16:54:03 +0000 URL: https://git.openjdk.org/jdk/commit/2865afe759fd5362abd0947fd4c1f5c8d3519ca3
19-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17471 Date: 2024-01-17 22:55:30 +0000
17-01-2024

[~tschatzl] you wouldn't still have the alternate CHT mutex ranking patch, would you? edit: I found it.
16-01-2024