46
questions
-2
votes
1
answer
106
views
How do you translate a stack trace / address on Mac so that you can use addr2line?
I am trying to store a stack trace in a form that can later be decoded using addr2line. I get the stacktrace itself via backtrace, but I dont know how to translate this into a positon independent ...
1
vote
0
answers
35
views
What is the correct way to use addr2line for a Linux PIE program?
We have raw addresses from a Linux program's call stack, but how do we use addr2line to convert the addresses if the program is a position-independent executable (PIE)?
In Windows, we can record the ...
1
vote
1
answer
112
views
How to detect if a function pointer comes from a shared library or the main executable?
I'm using backtrace and backtrace_symbols to get a stacktrace when a custom exception is thrown in my program (for now, on Linux... Ubuntu specifically)
trace_size = backtrace(stack_traces, ...
1
vote
0
answers
43
views
JNI core dump address to line number conversion?
How do I get the line number of an error in a JNI library (which I wrote) from a java core dump ? Alternatively, can I get the line numbers directly in the core dump ?
Here are 2 examples, depending ...
0
votes
1
answer
458
views
Get source location for address at runtime using debug information
In my C program, I have an instruction pointer that points to some address in virtual memory, e.g., a function pointer.
I would like to map this address to the corresponding source location (file path,...
2
votes
1
answer
308
views
addr2line - fails on basic example
#include <stdio.h>
void __cyg_profile_func_enter(void *func, void *caller) __attribute__((no_instrument_function));
void __cyg_profile_func_exit(void *this_fn, void *call_site) __attribute__((...
0
votes
0
answers
694
views
How to get line number for native crash in Android?
I have a native library and a backtrace from internal crash reporting tool that provides me exact addresses where the crash has occurred.
I used addr2line tool and found that it was our own native ...
0
votes
0
answers
158
views
How to covert the address from KCOV output to filename:lineno using addr2line?
I want to use KCOV (code coverage for fuzzing) in the Linux kernel to record the coverage of certain system calls. I have enabled the corresponding kernel configs started with the code example in the ...
0
votes
0
answers
244
views
why line number in .debug_line shows 0?
Why I'm seeing so many 0 Line number addresses in recently file compiled by clang?
like the result from llvm-dwarfdump below:
Address Line Column File ISA Discriminator Flags
-----------...
1
vote
1
answer
930
views
Given a library function how can I get its file offset?
Using backtrace and backtrace_symbols, I can get a mangled function name of interest (lets call it funcA_mangledName that belongs to libfsw.so.
My goal is to get the source file and line number where ...
2
votes
0
answers
362
views
How to convert numerical addresses in the stacktrace to symbols?
I have program that crashes from time to time with a following message in syslog.
Is this possible to modify it in a way, so instead of addresses there would be a readable message about function/line ...
3
votes
0
answers
2k
views
How to investigate tombstone crash data on Android
Occasionally users are seeing crashes in my app. The are running a signed version but I am able to get the tombstone crash data from their logcat. Trying to use the examples online to run addr2line ...
1
vote
1
answer
181
views
nm: some symbols are not related to any source file
In my embedded project I compile amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.c in this way:
/opt/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc \
-std=gnu11 \
-mcpu=...
0
votes
1
answer
1k
views
how to get line numbers same as lldb using atos/addr2line/llvm-symbolizer/lldb image lookup --address
I want to programmatically convert backtrace stack addresses (eg obtained from backtrace_symbols/libunwind) to file:line:column. I'm on OSX but doubt this makes a difference.
All of these give wrong ...
1
vote
0
answers
353
views
gdb backtrace - show inlined functions, like `addr2line -i` does
I have gdb attached to process. I print backtrace, one of frames looks like this:
#9 0x000055b748d7467b in CA::CryptUserKeysCache::addSongKeyFast (this=0x55b74e141a90, group_color=..., ...
0
votes
1
answer
837
views
addr2line with archive files
I am trying to use addr2line with a archive file libdpdk.a
I have a backtrace:
backtrace returned: 7
0: 0x46fd05 ./build/ip_pipeline(bt+0x25) [0x46fd05]
1: 0x42a163 ./build/ip_pipeline() [0x42a163]
...
1
vote
0
answers
706
views
What is this Unity Error? Addr2Line failure
Suddenly I have this error and I dont know how to solve.
I have this error on PC
/..........................................................
Addr2Line failure
Scripting Backend: il2cpp
Build Type: ...
2
votes
1
answer
8k
views
How to use atos? (or addr2line on Mac OS X)
I see the following example using addr2line. But the interfaces of atos and addr2line are different. I am not sure how to make it work using atos. Could anybody show me how to convert it to using atos?...
1
vote
2
answers
5k
views
C++ - Is there any command likes addr2line on Windows
If a Windows application crashed on user's device without pdb, it would produce callstack like this:
TestGame 0x000000003f790000 + 1c0c9f1
TestGame 0x000000003f790000 + 4b8a97c
TestGame ...
1
vote
2
answers
3k
views
How to identify the reason for memory corruption using Kernel Panic log?
My custom hardware is based on imax6q processor. Kernel I'm using - Linux-boundary 4.1.15. I'm getting kernel panics while running linux application on my custom hardware design. So how can I debug ...
1
vote
1
answer
4k
views
addr2line on kernel address cannot find source line
I am building a custom linux kernel (4.15.0 x86_64) with debug symbol enabled. I find that addr2line fails to point to the source code line.
addr2line -e vmlinux 0xffffffff9be625f0
gdb also returns &...
7
votes
0
answers
3k
views
addr2line command search path for debug symbols
I cannot make addr2line to work. It does look for symbols at three (unexisting) paths:
/usr/bin/*.debug
/usr/bin/.debug/*.debug
/usr/lib/debug/usr/bin/*.debug
But it just seems to ignore the path ...
2
votes
2
answers
2k
views
Libunwind PC value not working with addr2line
I am trying to follow along with an example from the link:
https://eli.thegreenplace.net/2015/programmatic-access-to-the-call-stack-in-c/
However I have run into a few issues. I have a piece of code ...
0
votes
1
answer
280
views
How to get function names from profile addresses?
I am putting together a performance profiler in Linux and I am having trouble mapping the collected stack trace information to function names.
I am currently calling addr2line as follows from my post ...
0
votes
1
answer
250
views
Making sense of the addr2line message with C++ STL
I have been having this rare segfault, and while debugging it, I managed to get the following output from addr2line program.
void std::string::_S_copy_chars<__gnu_cxx::__normal_iterator<...
5
votes
0
answers
674
views
How to get the function name from base.odex with address and offset
Here is an android app crash stacktrace:
F DEBUG : #05 pc 001d0949 /data/app/com.test-2/oat/arm/base.odex (offset 0x12a000)
I know for ".so" library, I can use addr2line to get the function name.
...
4
votes
1
answer
4k
views
How addr2line can locate the source file and the line of code?
addr2line translates addresses into file names and line numbers. I am still beginner in debugging, and have some questions about addr2line.
If am debugging a certain .so (binary) file, how the tool ...
1
vote
0
answers
746
views
addr2line produces question mark for line number
Recently while using addr2line for gRPC code I saw that it is not producing line number. The man page of add2line states that line number will be 0 if it can't determine.
$ addr2line -s -C -i -f -e ...
3
votes
0
answers
1k
views
Detect specific function calls in the source codes with objdump
I need a way to detect places, where a specific function is called.
E.g.:
myPrint():
main.c, line 28
utils.c, line 89
The point is, I need only function calls, not definitions or declarations. And I ...
0
votes
1
answer
1k
views
GCC. Generate limited debug info
Is there a way to force gcc to generate only subset of full debug info that will be sufficient for addr2line utility? Or any way to strip unneeded? I've tried
$ objcopy --only-keep-debug --remove-...
3
votes
1
answer
3k
views
How can I provide addr2line with a symbol file for use with a stripped binary in Ubuntu?
I have an C++ application running in Ubuntu. What I'd like to do is to strip the application binary of its symbols so that they are not part of the binary, but use the addr2line utility to get ...
5
votes
2
answers
2k
views
Reverse of addr2line
given an object file and address addr2line tool can relate it to a file and line number in the source code.
I'd like to have the opposite. Given a line number and an object file I want to get a list ...
3
votes
1
answer
2k
views
How to get Crash Point in Java code
My application has android-support-v4.jar in /libs only. I do not use other library.
My application is crashing with SIGNAL 11 error. I want to use addr2line utility of android-ndk. Can we find the ...
5
votes
0
answers
753
views
How to manually map an Android SIGSEGV address to linker map file?
My Java app has a JNI layer for communicating with a native C++ library. When the app is idle for approximately three (3) minutes, the app crashes, with LogCat showing the following stack trace:
07-...
1
vote
0
answers
220
views
BFD unknown command when using gaddr2line
I'm trying to use gaddr2line to print a prettier version of backtrace symbols. I'm just getting the addresses from backtrace() then feeding them to gaddr2line by executing it using popen. Using ...
0
votes
1
answer
1k
views
Get current execution path from within C library
I'm writing a logger library in C and am currently trying to get better backtrace output by using addr2line. In order to do so, I need to be able to get the path of the current executable. At the ...
1
vote
1
answer
2k
views
Why addr2line is not able to resolve certain address to function names?
I have backtraces obtained from executing the command dumpheap -n <PID> <file>. I have to convert these address to function names and line numbers to make these backtraces meaningful. I ...
7
votes
2
answers
4k
views
Analyze backtrace of a crash occurring due to a faulty library
In my application I have setup signal handler to catch Segfaults, and print bactraces.
My application loads some plugins libraries, when process starts.
If my application crashes with a segfault, due ...
4
votes
0
answers
2k
views
Is there a way to avoid that addr2line prints "question marks" lines
When I call addr2line on my program, I get an output of this form :
??
??:0
??
??:0
BdmLsim3::InitPopulation() at bdmLsim3/../src/Spatial/BdmLsim3.cpp:634
BdmLsim3::InitSimulation() at bdmLsim3/../...
27
votes
2
answers
14k
views
What's the "discriminator" in addr2line?
When running addr2line in some programs, I get a "discriminator N" comment at the end of the line:
main at /tmp/nsievebits.c:56 (discriminator 3)
The man page doesn't mention it, and a quick Google ...
24
votes
2
answers
12k
views
How do I access the `addr2line` functionality within my C++ program?
I need to get the information provided by addr2line (source file and line from backtracing a function call) from within a C++ program.
I know I can call addr2line directly as a subprocess and I know ...
1
vote
1
answer
6k
views
How do I use addr2line for Android?
My code (a game using AndEngine with PhysicsBox2DExtension on Android) is crashing and it has been suggested that I use addr2line, but I have absolutely not idea how to do it and the many "tutorials" ...
2
votes
3
answers
646
views
Is there an addr2line which analyzes Code in Memory?
I'm using addr2line to analyze the stacktrace after an exception was thrown (using backtrace and backtrace_symbols). Currently this takes about 2 seconds to analyze the 120Mb binary (debug build) from ...
15
votes
2
answers
13k
views
glibc function to retrieve current executable name?
i'm wondering if there is a glibc function that i can use from gcc/g++ that will retrieve the current executable.
The purpose of this is to provide the -e argument to addr2line as shown in this ...
64
votes
4
answers
151k
views
How to use the addr2line command in Linux?
I am trying to use addr2line command in Unix but everytime it is giving the same output as ??:0. I am giving command as addr2line -e a.out 0x4005BDC . I got this address while running this a.out ...
80
votes
2
answers
98k
views
How to use addr2line in Android
I am stuck with my app, as I am unable to debug as it is a multithreaded one and crashes with error SIGSEGV. I get lot of information from LogCat, which gives me addresses in my native library. It ...