public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* Missing .gnu_debugdata section on ARM platform when libdw is used by systemd-coredump
@ 2021-05-04 12:15 Tino Mettler
  2021-05-06  0:49 ` Mark Wielaard
  0 siblings, 1 reply; 3+ messages in thread
From: Tino Mettler @ 2021-05-04 12:15 UTC (permalink / raw)
  To: elfutils-devel

Hi,

I have a system running on 2 different architectures: AMD64 and ARM. When a coredump happens, I want systemd-coredump to generate a stack trace of the crashing application. Systemd depends on elfutils for this feature. I use binaries with minidebuginfo (the LZMA compressed symbol table in the .gnu_debugdata section) on both architectures.

I get a stack trace on AMD64, but not on ARM. While debugging this, I saw that find_aux_sym() from dwfl_module_getdwarf.c does not find a .gnu_debugdata section when iterating through the ELF using elf_nextscn().

However, it finds a .gnu_debuglink section. I inspected the executable and verified that it contains a .gnu_debugdata section and it looks fine. Interestingly, there is no .gnu_debuglink section in the executable despite elf_nextscn() seems to find one.

It looks like libdw does not process the actual executable, but a modified variant, and the .gnu_debugdata section gets lost at some point on my ARM device. Can you give me a hint where I need to look at? Both devices run a different kernel with a different configuration. Could that be related?

I also tried gdb using the coredump file from systemd-coredump and the same executable, and a stack trace worked as expected.

Regards,
Tino


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Missing .gnu_debugdata section on ARM platform when libdw is used by systemd-coredump
  2021-05-04 12:15 Missing .gnu_debugdata section on ARM platform when libdw is used by systemd-coredump Tino Mettler
@ 2021-05-06  0:49 ` Mark Wielaard
  2021-05-18 13:33   ` Tino Mettler
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2021-05-06  0:49 UTC (permalink / raw)
  To: Tino Mettler, elfutils-devel

Hi Tino,

On Tue, 2021-05-04 at 14:15 +0200, Tino Mettler via Elfutils-devel
wrote:
> I have a system running on 2 different architectures: AMD64 and ARM.
> When a coredump happens, I want systemd-coredump to generate a stack
> trace of the crashing application. Systemd depends on elfutils for
> this feature. I use binaries with minidebuginfo (the LZMA compressed
> symbol table in the .gnu_debugdata section) on both architectures.
> 
> I get a stack trace on AMD64, but not on ARM. While debugging this, I
> saw that find_aux_sym() from dwfl_module_getdwarf.c does not find a
> .gnu_debugdata section when iterating through the ELF using
> elf_nextscn().
> 
> However, it finds a .gnu_debuglink section. I inspected the
> executable and verified that it contains a .gnu_debugdata section and
> it looks fine. Interestingly, there is no .gnu_debuglink section in
> the executable despite elf_nextscn() seems to find one.
> 
> It looks like libdw does not process the actual executable, but a
> modified variant, and the .gnu_debugdata section gets lost at some
> point on my ARM device. Can you give me a hint where I need to look
> at? Both devices run a different kernel with a different
> configuration. Could that be related?
> 
> I also tried gdb using the coredump file from systemd-coredump and
> the same executable, and a stack trace worked as expected.

If possible you might want to post the core file and/or executables
somewhere so others can inspect them. I am not completely sure how the
.gnu_debugdata (aux symbols) is related. Are you getting a backtrace,
but not function symbols for the addresses?

For ARM it might depend on whether the executable contains an .eh_frame
sections. If it has (or the .debug file has an .debug_frame section)
then libdw should be able to produce a backtrace.

But there are also ARM binaries which only come with IDX data, which
libdw doesn't handle.

Cheers,

Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Missing .gnu_debugdata section on ARM platform when libdw is used by systemd-coredump
  2021-05-06  0:49 ` Mark Wielaard
@ 2021-05-18 13:33   ` Tino Mettler
  0 siblings, 0 replies; 3+ messages in thread
From: Tino Mettler @ 2021-05-18 13:33 UTC (permalink / raw)
  To: elfutils-devel


Hi Mark,

Am 06.05.2021 um 02:49 schrieb Mark Wielaard <mark@klomp.org>:
> 
> Hi Tino,
> 
> On Tue, 2021-05-04 at 14:15 +0200, Tino Mettler via Elfutils-devel
> wrote:
>> I have a system running on 2 different architectures: AMD64 and ARM.
>> When a coredump happens, I want systemd-coredump to generate a stack
>> trace of the crashing application. Systemd depends on elfutils for
>> this feature. I use binaries with minidebuginfo (the LZMA compressed
>> symbol table in the .gnu_debugdata section) on both architectures.
>> 
>> I get a stack trace on AMD64, but not on ARM. While debugging this, I
>> saw that find_aux_sym() from dwfl_module_getdwarf.c does not find a
>> .gnu_debugdata section when iterating through the ELF using
>> elf_nextscn().
>> 
>> However, it finds a .gnu_debuglink section. I inspected the
>> executable and verified that it contains a .gnu_debugdata section and
>> it looks fine. Interestingly, there is no .gnu_debuglink section in
>> the executable despite elf_nextscn() seems to find one.
>> 
>> It looks like libdw does not process the actual executable, but a
>> modified variant, and the .gnu_debugdata section gets lost at some
>> point on my ARM device. Can you give me a hint where I need to look
>> at? Both devices run a different kernel with a different
>> configuration. Could that be related?
> 
> If possible you might want to post the core file and/or executables
> somewhere so others can inspect them. I am not completely sure how the
> .gnu_debugdata (aux symbols) is related. Are you getting a backtrace,
> but not function symbols for the addresses?

I'll try to provide a minimal example for this. I get only frame #0 of the
stack and no complete stack trace.

> 
> For ARM it might depend on whether the executable contains an .eh_frame
> sections. If it has (or the .debug file has an .debug_frame section)
> then libdw should be able to produce a backtrace.
> 
> But there are also ARM binaries which only come with IDX data, which
> libdw doesn't handle.

There is a .eh_frame in the binary.

Regards,
Tino


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-18 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 12:15 Missing .gnu_debugdata section on ARM platform when libdw is used by systemd-coredump Tino Mettler
2021-05-06  0:49 ` Mark Wielaard
2021-05-18 13:33   ` Tino Mettler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).