Open shahms opened 4 years ago
What is happening here is that you are trying to unwind though glibc, which is compiled with optimization and without -fno-omit-frame-pointer
. Without a frame pointer, you can't walk the stack any further.
There is a workaround that we use in our production logging library. In glibc, __assert_fail()
is a weak function that you can replace with your own function, which you can build with frame pointers enabled.
Try adding something like this to your code:
extern "C" void __assert_fail(const char *assertion, const char *file, unsigned int line, const char *function) __THROW {
// Print an assertion message
abort();
}
I don't know what else we can do besides maybe documenting this.
After a fair amount of hunting around I found the internal workaround and added it myself, but some documentation would definitely have helped. I was hopeful that a more principled replacement might be possible based on detected libc version, but it's definitely not critical. Thanks!
Describe the bug
After setting up symbolization and installing a failure signal handler, a failing
assert()
with glibc does not produce a useful stack trace, consisting entirely of:Calling std::abort directly or CHECK-failing produces a useful stack trace:
Steps to reproduce the bug
What version of Abseil are you using? 0033c9ea91a52ade7c6b725aa2ef3cbe15463421
What operating system and version are you using
If you are using a Linux distribution please include the name and version of the distribution as well.
What compiler and version are you using?
Debian GNU/Linux rodete
What build system are you using?