JDK-8211852 : inspect stack during error reporting
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-10-08
  • Updated: 2019-05-28
  • Resolved: 2018-10-15
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 11 JDK 12
11.0.2Fixed 12 b16Fixed
Description
We already inspect the registers during error reporting, but some important pointers may be only on stack, especially on architectures which don't have so many registers.
Since hs_err files are often all we get after a crash, it is often valuable to spend a little space for more information about what's referenced on top of the stack.

This feature inspects the content of 8 stack slots of the top of the stack. The new section "Stack slot to memory mapping" shows up in hs_err files when a context is given and the output looks like the following example:

Stack slot to memory mapping:
stack at sp + 0 slots: 0xffffffff7b3b5c24: ucrypto_digest_final+0 in /lib/sparcv9/libucrypto.so.1 at 0xffffffff7b300000
stack at sp + 1 slots: 0x0000000100df6b50 points into unknown readable memory: 00 00 00 00 00 00 00 00
stack at sp + 2 slots: 0x0000000000000003 is an unknown value
stack at sp + 3 slots: 0xffffffff06a05bf0: _GLOBAL_OFFSET_TABLE_+0 in /jvm_12/lib/libj2ucrypto.so at 0xffffffff06900000
stack at sp + 4 slots: 0xffffffff7f18b7a8: __malloc_lock+0x18 in /lib/sparcv9/libc.so.1 at 0xffffffff7ef00000
stack at sp + 5 slots: 0xffffffff06a05f48: _PROCEDURE_LINKAGE_TABLE_+0x348 in /jvm_12/lib/libj2ucrypto.so at 0xffffffff06900000
stack at sp + 6 slots: 0x0 is NULL
stack at sp + 7 slots: 0x0000000100df6b50 points into unknown readable memory: 00 00 00 00 00 00 00 00

Comments
Fix Request This is a small enhancement to get a little bit more information when dumping hs_err files which seems to be beneficial to have in the LTS release (like jdk-8210754 which was backported recently). Fix has been tested in jdk12. New code is only used during error reporting, so I think the risk is low. Applies cleanly.
19-10-2018