`jhsdb jstack --mixed` would try to unwind all of native call frames. It will 
reach `_start()` (startup routine by glibc), but it couldn't on the JDK built 
by older glibc such as glibc-2.12 (used in devkit for Linux x86_64).

Expected:

0x000055ad324dfadb main + 0x13b
0x00007f3df876c681 __libc_start_call_main + 0x81
0x00007f3df876c798 __libc_start_main_alias_2 + 0x88
0x000055ad324dfb79 _start + 0x25


Actual (no `_start` in call stacks):

0x000055ad324dfadb main + 0x13b
0x00007f3df876c681 __libc_start_call_main + 0x81
0x00007f3df876c798 __libc_start_main_alias_2 + 0x88


Startup routine would be provided by crt1.o, and it would be linked into 
`java`. `_start()` in crt1.o by glibc-2.12 does not have Frame Description 
Entry (FDE) in DWARF. In DWARF parser in SA assumes native function has FDE, 
thus unwinder in SA would stop if it cannot find appropriate DWARF information.

I saw the problem on `_start()` only so far. This is not critical, but same 
problem can happen on other places (functions / libraries). We cannot find 
caller frame from DWARF-less function of course, but we should show the frame 
even if it does not have DWARF.

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

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

Commit messages:
 - fix in AArch64
 - Handle native frames without DWARF

Changes: https://git.openjdk.org/jdk/pull/31230/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31230&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8385136
  Stats: 30 lines in 3 files changed: 24 ins; 2 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/31230.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31230/head:pull/31230

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

Reply via email to