On Wed, 11 Nov 2026 09:20:53 GMT, Yasumasa Suenaga <[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).
>
> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java
>  line 52:
> 
>> 50:         dwarf = createDwarfParser(linuxDbg, pc);
>> 51:       } catch (DebuggerException e) {
>> 52:         if (linuxDbg.findLibPtrByAddress(pc) != null) {
> 
> You can use `hasNativeLibrary()` here.

`getFrameFromReg()` is a static method, so LinuxAARCH64CFrame needs to be 
instantiated if we use `hasNativeLibrary()` at this point.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33839#discussion_r4545342032

Reply via email to