[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Missing backtrace information on aarch64
From: |
Berat, Frederic (ADITG/ESA) |
Subject: |
RE: Missing backtrace information on aarch64 |
Date: |
Tue, 24 Mar 2020 09:26:14 +0000 |
Hi,
We recently face similar issue on arm64. I don't know for glibc, but libunwind
so far relies on the .eh_frame section to be available in order to properly
execute unw_step.
IMHO that's a limitation that could be solved by implementing fallbacks (ie
using the frame pointer). Though, another solution is to force gcc to generate
the eh_frame section, via one of the following options: -fexceptions,
-funwind-tables, or -fasynchronous-unwind-tables.
Best regards
Frederic Berat
Engineering System & Architecture (ADITG/ESA)
Tel. +49 5121 49 6935
Data protection information: We use your contact information and e-mail
communication to process your inquiry and for internal and possibly tax
documentation purposes. Your information will only be passed on to third
parties if this is necessary to carry out your request or if we are legally
obliged to do so.
-----Original Message-----
From: Libunwind-devel <libunwind-devel-bounces+fberat=address@hidden> On Behalf
Of Stephen Hemminger
Sent: Thursday, March 19, 2020 5:00 AM
To: Phil Reid <address@hidden>
Cc: address@hidden
Subject: Re: Missing backtrace information on aarch64
On Thu, 19 Mar 2020 08:34:35 +0800
Phil Reid <address@hidden> wrote:
> On 19/03/2020 01:45, Stephen Hemminger wrote:
> > Trying to use libunwind on Arm64 and discovered that it is not
> > working as expected. Only one function is printed.
> >
> > On x86 Debian 10 (1.2.1-9)
> > $ ./bt
> > ^\Signal Quit recevied
> > #0 0x5640deb47308 (sigquit+0x29)
> > #1 0x7f4337b8587f (killpg+0x40)
> > #2 0x7f4337c146f4 (nanosleep+0x14)
> > #3 0x7f4337c1462a (sleep+0x3a)
> > #4 0x5640deb4732c (main+0x1f)
> > #5 0x7f4337b7209b (__libc_start_main+0xeb)
> > #6 0x564
> >
> >
> > On Arm64
> >
> > # /tmp/bt
> > ^\Signal Quit recevied
> > #0 0xab9f2f927bf0 (sigquit+0x34)
> > Aborted (core dumped)
> >
>
It is a problem with the libunwind version.
Here is the glibc backtrace version on Arm64:
$ /tmp/bt
^\Signal Quit recevied
8: [/tmp/bt(+0x884) [0xab7351d21884]]
7: [/lib/libc.so.6(__libc_start_main+0xe4) [0xff4f6b618ce4]]
6: [/tmp/bt(+0xa54) [0xab7351d21a54]]
5: [/lib/libc.so.6(sleep+0x34) [0xff4f6b697304]]
4: [/lib/libc.so.6(nanosleep+0x24) [0xff4f6b69741c]]
3: [linux-vdso.so.1(__kernel_rt_sigreturn+0) [0xff4f6b7905b8]]
2: [/tmp/bt(+0xa28) [0xab7351d21a28]]
1: [/tmp/bt(+0x974) [0xab7351d21974]]
Aborted (core dumped)
Source:
/* Simple example of glibc-backtrace */
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <execinfo.h>
#include <unistd.h>
#define BACKTRACE_SIZE 256
static void print_backtrace(void)
{
void *func[BACKTRACE_SIZE];
char **symb = NULL;
int size;
size = backtrace(func, BACKTRACE_SIZE);
symb = backtrace_symbols(func, size);
if (symb == NULL)
return;
while (size > 0) {
fprintf(stderr,
"%d: [%s]\n", size, symb[size - 1]);
size--;
}
free(symb);
}
static void sigquit(int signo)
{
fprintf(stderr, "Signal %s recevied\n", strsignal(signo));
print_backtrace();
abort();
}
int main(int ac, char **av)
{
signal(SIGQUIT, sigquit);
for(;;)
sleep(30);
}