Hi, could I have a review of this patch.

This patch fixes [JDK-8391637](https://bugs.openjdk.org/browse/JDK-8391637).

On `risc-v`, 
[LinuxRISCV64CFrame.sender()](https://github.com/openjdk/jdk/blob/c368bac40e185398fbc40dc4d75a457f7a36f954/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/riscv64/LinuxRISCV64CFrame.java#L70)
 validates only FP alignment, then dereferences FP for SP, link, and return 
address. An aligned arbitrary FP (such as 0x90) can therefore cause 
UnmappedAddressException, and lead to incomplete stack for the target thread.

`aarch64` and `amdf64`already use `dwarf` to unwind native frames, see 
https://github.com/openjdk/jdk/blob/c368bac40e185398fbc40dc4d75a457f7a36f954/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java#L36
https://github.com/openjdk/jdk/blob/c368bac40e185398fbc40dc4d75a457f7a36f954/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java#L38

This patch makes `risc-v` to unwind with `dwarf` too. 

The `risc-v` version basically has the same design as the `aarch64` version. 
There are also several differences , primarily due to differences in calling 
conventions.  Almost every difference is accompanied by an explanatory comment.

I have ran tests in `test/hotspot/jtreg/serviceability/sa` on `risc-v` and 
`amd64`, all passed.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - Add comment
 - 8391637: On the RISC-V platform, TestJhsdbJstackMixed has a certain 
probability of failure

Changes: https://git.openjdk.org/jdk/pull/33358/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=33358&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8391637
  Stats: 393 lines in 11 files changed: 308 ins; 23 del; 62 mod
  Patch: https://git.openjdk.org/jdk/pull/33358.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33358/head:pull/33358

PR: https://git.openjdk.org/jdk/pull/33358

Reply via email to