JDK-8311542 : Consolidate the native stack printing code
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-07-06
  • Updated: 2024-12-25
  • Resolved: 2024-12-12
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 25
25 b03Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
We now print native stacks in a number of contexts, not just VMError reporting, and we have to try os::platform_print_native_stack else fall back to VMError::print_native stack. That logic should be captured in a single function, suitably located, so that the different client code can use it.

There are some inconsistencies to watch for as we don't have "source info" support with os::platform_print_native_stack, and secondary error reporting seems to assume we must have used VMError::print_native_stack.
Comments
Changeset: db9eab3f Branch: master Author: David Holmes <dholmes@openjdk.org> Date: 2024-12-12 23:15:48 +0000 URL: https://git.openjdk.org/jdk/commit/db9eab3f29e9cb26a8c0a7c31c55aaf140f21bed
12-12-2024

The refactoring adds a new NativeStackPrinter (NSP) helper class which can be constructed with some of the context information for the printing that will follow. This avoids the need for the print functions to have a large number of parameters. We have to expose both the top-level printing functionality and the "lower-level" frame-based stack walk as the error reporter needs access to that directly. To maintain the exact same format of output the NSP has to be aware of some error reporter usage requirements. Some frame management code was also moved to the frame class.
02-12-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22472 Date: 2024-12-02 07:36:59 +0000
02-12-2024