On Fri, 13 Nov 2026 05:29:13 GMT, Koichi Sakata <[email protected]> wrote:

>> This PR prevents the `clhsdb pstack` command from throwing a 
>> `DebuggerException` when obtaining the top frame. The exception occurs when 
>> the PC is within a native library that has no `.eh_frame` section.
>> 
>> I added a test, `ClhsdbPstackNoEhFrame.java`, that uses a native library 
>> without an `.eh_frame` section. The test fails with a `DebuggerException` 
>> without the fix in `LinuxAARCH64CFrame.java`.
>> 
>> `getFrameFromReg()` returns the current frame without DWARF information if 
>> DWARF parsing fails and the PC is within a known native library. Unwinding 
>> stops at this frame, but analysis continues for other threads. This behavior 
>> is consistent with the existing `sender()` method.
>> 
>> #### Testing
>> I've run the following tests on Linux AArch64.
>> 
>> $ make run-test 
>> TEST="jtreg:hotspot/jtreg/serviceability/sa/ClhsdbPstackNoEhFrame.java"
>>    TEST                                              TOTAL  PASS  FAIL ERROR 
>>  SKIP
>>    jtreg:test/hotspot/jtreg/serviceability/sa/ClhsdbPstackNoEhFrame.java
>>                                                          1     1     0     0 
>>     0
>> $ make run-test TEST="jtreg:hotspot/jtreg/serviceability/sa/"
>>    TEST                                              TOTAL  PASS  FAIL ERROR 
>>  SKIP
>>    jtreg:test/hotspot/jtreg/serviceability/sa           81    76     0     0 
>>     5
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Koichi Sakata has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Try to read .debug_frame if no .eh_frame

I've applied the changes and confirmed that the `pstack` outputs of the 1st and 
2nd cases have the caller information.
Regarding the test patterns, should I create the following 3 cases?

- no `.eh_frame`, but `.debug_frame` in the library
- has `.eh_frame`, but it doesn't cover the target function. `.debug_frame` in 
the library has the FDE of the function
- no available information for the target function in `.eh_frame` and 
`.debug_frame` in the library or external debuginfo

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

PR Comment: https://git.openjdk.org/jdk/pull/33839#issuecomment-6845119232

Reply via email to