I have a big C++ code (server for some application).
This application is big, and catch a crash per 2 months in average.
And i can't simulate this crash to catch her with gdb
.
Is exists some cool api to analyze memory on crash dump (stacktrace, local vars)?
What is best way to catch 开发者_StackOverflowstack corruption time?
Enable core dumping, wait for it to crash. Then load the core into gdb and debug as usual.
ulimit -c unlimited
There are several things you can do :
1. Unit test your code, and execute them using valgrind
2. enable core dumps (as Let_Me_Be said in his answer)
精彩评论