JDK-8322345 : Release Note: Hotspot `hs_err` Files Now Print the Lock Stack
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21.0.2,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2023-12-18
  • Updated: 2024-02-27
  • Resolved: 2024-01-30
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
21.0.2Resolved 22Resolved
Description
A section containing the thread local lock stack has been added to `hs_err` report files. It only gets printed when the new lightweight locking mode is enabled (`-XX:LockingMode=2`).

An example is given here with details about the locked objects omitted:
```
Lock stack of current Java thread (top to bottom):
LockStack[1]: nsk.share.jdi.EventHandler 
...
LockStack[0]: java.util.Collections$SynchronizedRandomAccessList
...
```
It lists objects which are lightweight locked, through `synchronized` methods or statements, by the Java thread which is being analyzed. The object which has been locked most recently is printed first. Objects which are not lightweight locked are not displayed in this section.

Comments
That's fine. Thanks for your review!
31-01-2024

Okay. In that case I think > It lists objects which are locked should say > It lists objects which are lightweight locked The implication being this is not an exhaustive list of objects locked by the thread, but only those that are presently lightweight locked. I've taken the liberty of making that change.
31-01-2024

[~dholmes] I've replaced "Other locked objects" by "Objects which are not lightweight locked".
30-01-2024

Runtime Triage: [~mdoerr] Would appreciate any clarification you can provide for David's question above.
23-01-2024

I have done an editorial pass and added markdown formatting. I removed references to "fast locking" as we don't use that terminology any more. > Other locked objects are not displayed in this section. Is this referring to things like ReentrantLock, or does other mean "for other threads"? This needs clarifying.
11-01-2024