0

I am using backward-cpp (https://github.com/bombela/backward-cpp) to print the stack trace. However, this gives segmentation fault. Following is the gdb trace of the stack :

0x00007ffff608e357 in _Unwind_Backtrace () from /lib/x86_64-linux-gnu/libgcc_s.so.1
(gdb) bt full
#0  0x00007ffff608e357 in _Unwind_Backtrace () from /lib/x86_64-linux-gnu/libgcc_s.so.1
No symbol table info available.
#1  0x000055555567225c in backward::details::Unwinder<backward::StackTraceImpl<backward::system_tag::linux_tag>::callback>::operator() (this=0x7ffff7ee7410, f=..., depth=32)
    at inc/backward.hpp:814
No locals.
#2  0x000055555566d66a in backward::details::unwind<backward::StackTraceImpl<backward::system_tag::linux_tag>::callback> (f=..., depth=32) at inc/backward.hpp:857
        unwinder = {_f = 0x7ffff7ee7408, _index = 13, _depth = 32}
#3  0x00005555556666d2 in backward::StackTraceImpl<backward::system_tag::linux_tag>::load_here (this=0x7ffff7ee74c0, depth=32, context=0x0, error_addr=0x0) at inc/backward.hpp:875
        trace_cnt = 140732520194072

I compiled the code with -g. How can I resolve the issue?

Proy
  • 336
  • 2
  • 13
  • Null pointers always creep me out. I wonder if `context=0x0` or `error_addr=0x0` is significant. – user4581301 Mar 01 '22 at 01:44
  • Are you grabbing the stack trace because the program failed or otherwise is about to die? If so did it die because of a stack overflow or stack corruption that the unwinder can't handle? – user4581301 Mar 01 '22 at 01:56
  • No, the code does not die otherwise. I am interested to get the calling context during certain function calls. – Proy Mar 01 '22 at 02:42

0 Answers0