How to use addr2line tool to get a backtrace


#1

How to use addr2line tool to get a backtrace

Context

Use of the addr2line tool to convert stacktrace addresses into code lines in order to troubleshoot a server crash.

Method

Save stacktrace to a file

grep 'stacktrace' aerospike.log >  MY_STACKTRACE_FILE.txt

Run addr2line to retrieve the backtrace

addr2line -i -C -f -e /usr/bin/asd $(cat MY_STACKTRACE_FILE.txt |grep -Eo '\0x[0-9A-Za-z]{6}'|tr '\n' ' ') > MY_BACKTRACE_CASEXXXX.txt

Keywords

crash gdb stacktrace infoline backtrace bt coredump addr2line

Timestamp

7/29/16