Linux crash native stacks only have 1 line

Florian Weimer fweimer at redhat.com
Wed Apr 8 17:32:04 UTC 2020


* Alexander Miloslavskiy:

> On 08.04.2020 16:25, Volker Simonis wrote:
>> Libjvm.so is already linked against libgcc anyway (either statically
>> or dynamically, depending on the "--with-stdc++lib" configure option".
>
> I understand that this means that yes, libgcc is fine to use.

Not really.  You need libgcc_s.  You can link the unwinder statically,
but you really, really do not want to do that because sometimes, the
operating system has newer unwinding information than what is understood
by the statically linked copy of the unwinder.  Having multiple copies
of the unwinder in the same process can cause issues as well (but the
way OpenJDK uses hidden symbols tends to reduce that particular risk).

> I see that `backtrace()` is almost perfect!

Some distributions build with -fno-unwind-tables, or do not patch GCC to
generate the tables by default.  I expect you will get very different
results on such distributions.  But if the tables are there, the
unwinder (whether used via backtrace or directly via the _Unwind_*
functions) gives very good results for valid call stacks.

(Personally, I think stripping unwind tables is wrong, and this happens
to align with what we try to do in Fedora and downstream, but that is
not the only opinion out there.)

Thanks,
Florian



More information about the hotspot-dev mailing list