JDK-8217879 : hs_err should print more instructions in hex dump
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-01-28
  • Updated: 2022-09-15
  • Resolved: 2019-02-01
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 JDK 13
11.0.4Fixed 12.0.2Fixed 13 b07Fixed
Related Reports
Relates :  
Relates :  
Description
Currently the "Instructions" block in hs_err prints "only" 64 bytes window around PC:

Instructions: (pc=0x00002b577170e763)
0x00002b577170e743:   e5 48 83 ec 20 8b 77 30 48 8d 7d e0 64 48 8b 04
0x00002b577170e753:   25 28 00 00 00 48 89 45 f8 31 c0 e8 fd f4 3a ff
0x00002b577170e763:   c7 04 25 00 00 00 00 00 00 00 00 0f 0b 55 48 89
0x00002b577170e773:   e5 41 57 41 56 41 55 41 54 4c 8d a5 00 fe ff ff 

That is too small of the window to debug, especially when large instructions are encoded. Larger window would make debugging easier.

Larger window may risk touching the unreadable memory, in which case hs_err machinery would print something like:

Instructions: (pc=0x0000000000000000)
0x0000000000000000:   
[error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xb, SIGSEGV (0xb) at pc=0x00007f9e0a6e59a5]

Comments
Fix Request Backporting this patch improves post-mortem analysis of compiler failures by providing more context around the failing instruction. It relies on JDK-8217994 improvements (already backported) to be extra-safe with touching more memory around potentially corrupted address. Patch applies to 12u and 11u cleanly, and passes tier1 x86_64 tests.
18-04-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/853c68ff2ed7 User: shade Date: 2019-02-01 15:04:10 +0000
01-02-2019

Webrev: http://cr.openjdk.java.net/~shade/8217879/webrev.01/ -- runs through jdk-submit now.
28-01-2019