Search code examples
c++linuxgdbcrash-dumps

Dump of process in crash/quit time for gdb import?


I have C++ software (server) and its crashing, i don't know exactly where problem is based on logs. I want make something that linux after crash or quit do dump of that process that i will someway import that this file to gdb and analyze what is doing what not should.

Anyone do something in past? Can someone help me with some informations ideas or something?

Thanks!


Solution

  • What you want is a regular core dump which works with GDB to find the crash location. See http://linux.die.net/man/5/core for information.

    If the daemon does not have write permission where the current directory is, no core will be generated. To redirect it, try;

    mkdir /tmp/corefiles 
    chmod 777 /tmp/corefiles 
    echo "/tmp/corefiles/core" > /proc/sys/kernel/core_pattern