RFR: 8369322: runtime/jni/nativeStack/TestNativeStack.java fails on Windows AArch64
Saint Wesonga
duke at openjdk.org
Tue Oct 7 22:28:18 UTC 2025
HAVE_PLATFORM_PRINT_NATIVE_STACK is not defined on Windows AArch64. Consequently, Windows AArch64 uses the [implementation of os::platform_print_native_stack that returns false](https://github.com/openjdk/jdk/blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/share/runtime/os.inline.hpp#L36-L41). This results in [NativeStackPrinter::print_stack](https://github.com/openjdk/jdk/blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/share/utilities/nativeStackPrinter.cpp#L32) having to call [NativeStackPrinter::print_stack_from_frame](https://github.com/openjdk/jdk/blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/share/utilities/nativeStackPrinter.hpp#L99-L106) instead. However, the context is null in that case. As a result, the [frame used for printing the stack](https://github.com/openjdk/jdk/blob/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/share/utilities/nativeStackPrinter.hpp#L103) is obtained from [os::current_frame()](https://github.com/openjdk/jdk/blo
b/b50c11f9077f071cf5639de7e82ec261e0338532/src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp#L165-L168), which returns an empty frame. The frame's pc() method returns `nullptr` and `Native frames: <unavailable>` is printed.
This change defines the `os::platform_print_native_stack` method for Windows AArch64 and adapts the implementation of the Windows x64 `os::win32::platform_print_native_stack` method to support Windows AArch64.
-------------
Commit messages:
- Implement platform_print_native_stack for Windows AArch64
Changes: https://git.openjdk.org/jdk/pull/27680/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27680&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8369322
Stats: 202 lines in 3 files changed: 110 ins; 92 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/27680.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27680/head:pull/27680
PR: https://git.openjdk.org/jdk/pull/27680
More information about the hotspot-runtime-dev
mailing list