Wind River Support Network

HomeDefectsLIN6-8467
Fixed

LIN6-8467 : backtrace with call from raise or abort does not give a valid backtrace on ARM

Created: Sep 24, 2014    Updated: Dec 3, 2018
Resolved Date: Dec 23, 2014
Found In Version: 6.0
Fix Version: 6.0.0.16
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Toolchain

Description

Using backtrace is a common way to give a printout trace a faulty state. On ARM this does not give a good backtrace especially when using pthreads.

On ARM:
 Obtained 6 stack frames.
./bt_loop2(print_trace+0x20) [0x89a8]
./bt_loop2() [0x8af4]
/lib/libc.so.6() [0x46a4fba0]
/lib/libc.so.6() [0x46a40d16]
/lib/libc.so.6(gsignal+0x25) [0x46a4ef8e]
/lib/libc.so.6(abort+0xef) [0x46a51860]

On x86 (native compiler):
Obtained 9 stack frames.
./out/native/bt_loop2(print_trace+0x19) [0x400c36]
./out/native/bt_loop2() [0x400d3d]
/lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7fb9c75fbc30]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7fb9c75fbbb9]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fb9c75fefc8]
./out/native/bt_loop2(dummy_function+0x41) [0x400cf8]
./out/native/bt_loop2(main+0xb6) [0x400df5]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fb9c75e6ec5]
./out/native/bt_loop2() [0x400b59]

Compile options for ARM:
CC=arm-wrs-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -tthumb2-v7-a-neon --sysroot=/RCS/wrl6/example/getrelease/out/axm5516/wrlinux_600/sdk-20140820/sysroots/armv7a-vfp-neon-wrs-linux-gnueabi -g -rdynamic -funwind-tables -mapcs-frame -fno-omit-frame-pointer

Compile options for x86:
gcc -g -rdynamic

Workaround

The attached new glibc binary should have fixed the problem.

cd <target rootfs>
rm -f lib/libc-2.18.so lib/.debug/libc-2.18.so
cd lib
tar xjf <path to libc-2.18.so.tar.bz2>

Steps to Reproduce

./bt_loop2 -a
and 
./bt_loop2_pthread -a

Other Downloads


Live chat
Online