I have a very complex cross-platform application. Recently my team and I have been running stress tests and have encountered several crashes (and core dumps accompanying them). Some of these core dumps are very precise, and show me the exact location where the crash occurred with around 10 or more stack frames. Others sometimes have just one stack frame with ?? being the only symbol!
What I'd like to know is:
Here's how I compile the binaries (in release mode):
Yet I sometimes get core dumps with no symbols at all! It's understandable that I'm linking against non-debug version of libstdc++ and libgcc, but it would be nice if at least the stack trace shows me where in my code did the faulty instruction call originate (although it may ultimately end in ??).
At your Unix/Linux command prompt, type "limit". The ulimit command has a different syntax. For more details type "man bash" (or ksh or sh) and search for "ulimit".
The maximum size of the resulting core filename is 128 bytes (64 bytes in kernels before 2.6. 19). The default value in this file is "core".
Others sometimes have just one stack frame with "??" being the only symbol!
There can be many reasons for that, among others:
-fomit-frame-pointer
or asm units that do soNote that the second point may occur simply by, for example, glibc being compiled in such a way. Having the debug info for such system libraries installed could mitigate this (something like what the glibc-debug{info,source} packages are on openSUSE).
gdb has more control over the program than glibc, so glibc's backtrace
call would naturally be unable to print a backtrace if gdb cannot do so either.
But shipping the source would be much easier :-)
As an alternative, on a glibc system, you could use the backtrace
function call (or backtrace_symbols
or backtrace_symbols_fd
) and filter out the results yourself, so only the symbols belonging to your own code are displayed. It's a bit more work, but then, you can really tailor it to your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With