I am currently facing issue with the glibc v2.22 where I am not able to get the proper unwind information. When there is SIGABRT application, it is calling abort function from glibc. It should be using unwind information which is enabled in the build. However, it is scanning the stack (as indicated by the red line below the address in the screenshot) and providing the misleading information as shown in the screenshot attached (using sentry for analyzing the dump).
Here, do_crash is called which does assert(0) which then aborts the main application. While analyzing the dump, the do_crash function calls the _fini which is never in the main application's stack.
I have enabled unwind for the glibc by using CFLAGS += "-funwind-tables". I also tried with the flags such as -rdynamic and -fno-omit-frame-pointer but it was also of no use.
Am I missing something here? How can I get the complete backtrace of the signals, particularly SIGABRT?
Thanks in advance
That is not true, this is not happening, unless you explicitly registered it.
It tells the compiler to add the information, it doesn't "enable unwind". What exactly happens when compiling with -funwind-tables?
This is not related to receiving SIGABRT signal.
I believe you are making wrong assumptions - that something is called on SIGABRT, that SIGABRT is sent on assert, that
abort()is called onSIGABRT. Nothing is called on SIGABRT and the program is terminated when receiving SIGABRT by default (seeman 7 signal),assertjust terminates the program and doesn't raise SIGABRT, andabort()raises theSIGABRTsignal, not receives it.Register a handler that will do that. See How to automatically generate a stacktrace when my program crashes .
If you want to print stacktrace on
assert()that's completely different and you would overwrite the glibc handler for assert to do that: