Closed diehard2 closed 1 month ago
looking a little closer, I can use libbacktrace to get the function name and offset if I use backtrace_syminfo() using the same backtrace_state, so it knows that main() exists
it is giving the correct stacktrace in Release
Sorry, I don't know what is happening. This kind of problem is essentially impossible for me to debug unless I can reproduce it myself. The most likely cause is that the file containing the main
function was compiled without -g
.
The fact that backtrace_syminfo
succeeds doesn't tell us much, as backtrace_syminfo
does not require the debug info produced by -g
. In particular, backtrace_syminfo
doesn't report the file and line number.
Without more information there is nothing I can do. Please comment if there is some way to make progress.
So, this is strange. I'm using boost::stacktrace with libbacktrace, but I've reproduced it on a smaller scale with libbacktrace directly. Everything but information on my main() is showing up correctly (in my limited testing)
For instance, these are my stacktraces at two different points
and
I'm using gcc 13.1 and these are in a debug build. I'm running Ubuntu 22.04 in a docker container. My options are below.
I'm pretty sure the "main in build/Debug/bin/broker" is a nicety added by boost. In my reproducer I'm seeing
0x561dd7eb9cf5. (null):0: function -
Any help would be appreciated here