JDK-8242181 : [Linux] Show source information when printing native stack traces in hs_err files
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12,13,14,15,16,17,18,19,20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2020-04-06
  • Updated: 2025-05-07
  • Resolved: 2022-08-24
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 20
20 b12Fixed
Related Reports
Blocks :  
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
As a follow-up to the implementation for Windows (JDK-8185712) to show source information (filename and line numbers) in the stack trace in the hs_err file of a VM crash, we should also provide this information in hs_err files for Linux. The Windows implementation provided the foundation to add support for other platforms (Decoder::get_source_info()).

Stack trace from a crash on Windows:
V  [jvm.dll+0x4238fe]  nmethodBucket::next_not_unloading+0x7e  (dependencycontext.cpp:345)

vs. same crash on Linux:
V  [libjvm.so+0x8f38d5]  nmethodBucket::next_not_unloading()+0x45

which makes it hard to exactly know which line caused the crash. The line information would improve the analysis of a VM crash.


More information about the Windows version: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2017-August/024286.html


A first version supports the following:
- DWARF version 4 (emitted by GCC by default)
- 32 and 64-bit Linux builds

Not (yet) supported:
- DWARF version 1
- Partially supported only: DWARF version 2, 3
- DWARF version 5 (still experimental in GCC 10 while being the default for GCC 11)

Filed JDK-8287021 to add support for DWARF 5 while the other older versions (1-3) are most likely not gonna be supported in the future as they are too old (DWARF 4 is already 12 years old).
Comments
[17u-no] Hi [~asmehra], I see the benefit in having the line numbers. But this is a large change and it has a lot of follow-up issues. I think the risk of destabilizing the JVM or the testing is to big. After all, the next LTS is available now.
15-12-2023

Fix request 17u. Backporting this patch would help in debugging crashes, thus improving serviceability. Patch applies with minor adjustments.
12-12-2023

Fix request 17u. I am working on backporting it.
06-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2021 Date: 2023-12-06 00:32:31 +0000
06-12-2023

Changeset: 13c03696 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2022-08-24 06:44:06 +0000 URL: https://git.openjdk.org/jdk/commit/13c03696463cb3ba77663edfd2dfb78d3f45cbaa
24-08-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7126 Date: 2022-01-18 13:19:39 +0000
24-01-2022

Assigned it to myself out of interest. If anyone wants to step forward to do it, feel free to do so.
06-04-2020