2

I have run my app for several hours, and it has crashed. (c++ app, on LINUX os)

I know that when running app via gdb, we can get the line code & reason of the crash. But unfortunately I forgot to run it via gdb :( Is there a way to get the reason of the crash ?

user3668129
  • 4,318
  • 6
  • 45
  • 87
  • 2
    Was it a debug build, do you have a core file, and do you have symbols? If so (hopefully) [see this question/answers](http://stackoverflow.com/questions/5115613/core-dump-file-analysis). – WhozCraig Sep 04 '14 at 05:34
  • 1
    You should enable core dumps (e.g. with `ulimit -c` in the bash shell where you run the app). – Basile Starynkevitch Sep 04 '14 at 05:41

1 Answers1

3

You can enable unlimited core dump sizes by

ulimit -c unlimited

This will write down a core file in case of a crash into the same directory from where you started the program. Afterwards you can load it with the gdb option --core.

Cauterized
  • 41
  • 3