Questions tagged [libunwind]

43 questions
9
votes
1 answer

Different offset in libc's backtrace_symbols() and libunwind's unw_get_proc_name()

I make a stack trace at some point in my program. Once with libc's backtrace_symbols() function and once with unw_get_proc_name() from libunwind. backtrace_symbols() output: /home/jj/test/mylib.so(+0x97004)[0x7f6b47ce9004] unw_get_proc_name()…
tur1ng
  • 3,139
  • 5
  • 24
  • 31
6
votes
2 answers

Is there a portable/standard-compliant way to get filenames and linenumbers in a stack trace?

I've just read How to generate a stacktrace when my gcc C++ app crashes which is pretty old by now (5 years). Some answers suggest solutions allowing you to get, for every stack frame, the name of the function and an offset (within the stack I…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
4
votes
2 answers

Print C stack trace on Android 5/Lollipop

I'm trying to debug JNI code written in C running on Android 5. When one of my functions is called, I want to write a stack trace to the adb log so I can see where the function was called from. The first resources I found indicated I needed to use…
3
votes
1 answer

Using libunwind for implementing exceptions

Working on a compiler, need some assistance understanding and working with libunwind. Here's what I have so far: #define UNW_LOCAL_ONLY #include #include #include #include #include typedef…
3
votes
1 answer

_Unwind_Backtrace for different context on FreeRTOS

Hello I am trying to implement error handling in FreeRTOS project. The handler is triggered by WatchDog interrupt, prior to WatchDog reset. The idea is to log task name + call stack of the failed task. I have managed to backtrace a call stack but in…
Krasi.Jord
  • 31
  • 1
  • 5
2
votes
1 answer

Is llvm-libunwind safe to call from signal handler?

There is a multithreaded app running on Linux, CPU architecture is x86_64. I want to be able to obtain stack trace as backtrace() function does. After signal handler returns the app will continue running. This is SIGUSR1 handler. backtrace() is…
ivan_onys
  • 2,282
  • 17
  • 21
2
votes
1 answer

What means (3) in fnc(3)?

Looking libunwind.h docs(https://www.nongnu.org/libunwind/docs.html), All functions(ex.libunwind-ia64(3), unw_get_proc_name(3)) have fnc name + (3). What means (3)?
lgm0905
  • 125
  • 1
  • 5
2
votes
0 answers

Is it possible to get a kernel backtrace for a process stopped with ptrace/gdb?

I'm using ptrace(2) and libunwind on Linux to sample user-level stacks from a running process, which works well. However, if I try to look at the kernel-level stack in /proc//stack I always see the following: [<0>] ptrace_stop+0x155/0x270 [<0>]…
Atheriel
  • 61
  • 4
2
votes
1 answer

_Unwind_RaiseException example

I'm investigating the LLVM's libunwind library. I'd like to write or to look at a simple example which directly calls the _Unwind_Reason _Unwind_RaiseException( struct _Unwind_Exception *exception_object ); function. Does any one know whether…
embedc
  • 1,485
  • 1
  • 6
  • 20
2
votes
1 answer

Getting linker errors when linking against libunwind for a library in my project

I am running this command -- /usr/bin/c++ CMakeFiles/XYZ.dir/test/XYZ.cpp.o CMakeFiles/XYZ.dir/test/TempDir.cpp.o -o XYZ libXYZMaster.so -lboost_filesystem -lboost_system /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so…
user855
  • 19,048
  • 38
  • 98
  • 162
2
votes
2 answers

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 like so that uses libunwind to print backtrace…
Raees Rajwani
  • 487
  • 5
  • 18
2
votes
0 answers

Linking unwind library statically results in core dump

This code, compiles with g++ using -std=c++11. Linking with g++, when libunwind is linked in statically program crashes after catching in exerciseBug (after rethrow). LDFLAGS that result in crash: -Wl,-Bstatic -lunwind -Wl,-Bdynamic -llzma when…
Jeffrey DeLeo
  • 1,672
  • 13
  • 19
2
votes
2 answers

Add library to Cmake project

Perhaps I simply can't find it, but I want to add some code to a project of mine (libunwind found here http://www.nongnu.org/libunwind/download.html) This library does not come with a CMakeLists.txt file and when I try to include it cmake complains…
Darakian
  • 619
  • 2
  • 9
  • 22
2
votes
0 answers

cannot compile boost::stacktrace

The question is about the following library, which is expected to try to become part of boost. https://github.com/apolukhin/stacktrace Trying to compile with this makefile: CC = g++ CFLAGS = -c -O2 -Wall -std=c++1y -DHAVE_CSTDDEF -I …
nekrald
  • 21
  • 2
2
votes
0 answers

Using libunwind on ARMV7HF or ARMV5TE daemon app has no stack trace depth

I have written a C++ application (deamon) which has some issues with application crashing due segmentation faults. To get information about the code where the crash(es) happens i use libunwind. Which works very well on x86_x64 linux systems. There i…
ChriD
  • 21
  • 4
1
2 3