RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v2]

Yasumasa Suenaga ysuenaga at openjdk.org
Fri Oct 24 07:11:02 UTC 2025


On Fri, 24 Oct 2025 01:25:06 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> @RealFYang Thank you for sharing it!
>> 
>> I think it might be caused by binary difference, it is not caused by this PR at least. So I think we can go forward this PR, make sence?
>> 
>> Your .jtr file implies stack unwinding was failed from the function by libc in following:
>> 
>> ----------------- 2310034 -----------------
>> "SteadyStateThread" #39 prio=5 tid=0x00007fd2600358a0 nid=2310034 waiting for monitor entry [0x00007fd2351f4000]
>>    java.lang.Thread.State: BLOCKED (on object monitor)
>>    JavaThread state: _thread_blocked
>> 0x00007fd267930f16      __futex_abstimed_wait_common + 0xc6
>> ----------------- 2310033 -----------------
>> "ForkJoinPool-1-worker-2" #38 daemon prio=5 tid=0x00007fd1ec006600 nid=2310033 runnable [0x00007fd2352f5000]
>>    java.lang.Thread.State: RUNNABLE
>>    JavaThread state: _thread_in_native
>> 0x00007fd26797a545      __clock_nanosleep + 0x65
>> 0x00007fd26797ee53      __GI___nanosleep + 0x13
>> 
>> 
>> Native stack unwinding on Linux AMD64 depends on DWARF (in AArch64, it depends on FP (x29) yet).
>> I downloaded and checked libc.so.6 in libc6-udeb_2.41-12_amd64.udeb, it has `.eh_frame` section which would be used by `DwarfParser`, but it does not have any symbols, and not have `.gnu_debuglink` ELF section. OTOH Fedora 43 which I confirmed to work has both symbols and `.gnu_debuglink`.
>> 
>> They are used for symbol resolution, not stack unwinding. However other difference(s) in binary might affect statck unwinding. Thus I think it is not a problem caused by this PR.
>
> Hi, I am just wondering if there is a workaround for these platforms. Or can we simply skip this when testing on them? Say, if this depends on the availability of pstack, maybe we can add check for that then. Otherwise, we may introduce test noise for people who use them.

I could reproduce the problem not only Ubuntu 22.04 but also 23.04 . However it did not happen on Ubuntu 24.04 .
According to your report, the problem would happen on AArch64, it implies the problem is not in DWARF parser only. (DWARF parser is only available on Linux AMD64 so far)

AFAICS stack unwinding would fail from the function in glibc (on Ubuntu 22.04 and 23.04 at least), so I suspect something wrong in glibc binary and/or behavior and/or compiler options on Ubuntu. but I'm not sure.

I checked glibc version from `gnu_get_libc_version()`. "2.37" is returned on Ubuntu 23.04, and "2.39" is returned on Ubuntu 24.04 . So I think it can be `gnu_get_libc_version()` with FFM at first of the test, then the test is skipped if it runs on glibc 2.38 or earlier. Is it ok?

I grep'ed test directory with "mixed", I found another tests (TestJhsdbJstackMixed.java, TestJhsdbJstackPrintVMLocks.java). I will add glibc check to them as another ticket if this solution is ok.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27885#discussion_r2459103358


More information about the serviceability-dev mailing list