backtrace() not working on ARMv7a

Rajendra Dendukuri rajendra at
Thu Sep 12 12:49:45 UTC 2013

Thanks Shreyas for the tip. But it is not working even with "-fexceptions" or "-fasynchronous-unwind-tables" options.

Anyone faced this issue before?


From: SHREYAS JOSHI [mailto:dexterous.me82 at]
Sent: Thursday, September 12, 2013 2:33 AM
To: Rajendra Dendukuri; uclibc at
Subject: Re: backtrace() not working on ARMv7a

Try -fexceptions.

For further details, check the following link.

Thanks & regards,
Shreyas Joshi

From: Rajendra Dendukuri <rajendra at<mailto:rajendra at>>
To: "uclibc at<mailto:uclibc at>" <uclibc at<mailto:uclibc at>>
Sent: Wednesday, September 11, 2013 10:01 PM
Subject: backtrace() not working on ARMv7a

Hi uclibc list,

I am trying to generate a call stack trace using backtrace() API which is part of libubacktrace. The idea is to catch a SIGSEGV signal and call backtrace() to print all the address values and compare the obtained addresses from objdump -D of executable. Attached is a simplified version of the application. Following is the output seen on ARMv7a platform with buildroot cross-toolchain (gcc- 4.6.3, uClibc-, binutis-2.21.1).

To compile the application:
${CROSS_COMPILE}gcc -o crash_test -O0 -funwind-tables -rdynamic crash_test.c

ARMv7a# ./crash_test
Trying to access NULL pointer!
SIGSEGV Handler!
Got Backtrace Size=2

The above function call trace is only that of the signal hander (print_back_trace, sigsegv_handler) and does not show the entire call stack for the function where program crashed (print_back_trace, sigsegv_handler, func2, main).

On x86 host same program shows a deeper function call trace right up to the main function and even beyond:
Trying to access NULL pointer!
SIGSEGV Handler!
Got Backtrace Size=7

Can someone please comment on what is going wrong. Any special flags that need to be used while compiling/linking the program.


uClibc mailing list
uClibc at<mailto:uClibc at>

More information about the uClibc mailing list