Sometimes your programs crash and you need to do “postmortem” analysis (another case is that someones else’s program crashes and you need to send them core dump file), for that you need core dump file.

By default most Linux distributions disable automatic creation of core dump files during crash of a process, but it can be easily enabled. In Bash shell:

ulimit -c unlimited

Next time the program in question crashes, the Linux Kernel will create core dump file in cwd (current working directory) of the process in the opened terminal. Keep in mind that you need to run this command in each terminal where you want to enable the creation of core dump files.

If you typically want to create core dumps during process crash, you can put the line

ulimit -c unlimited

in your shell’s start-up file (e.g. ~/.bashrc for bash).

Leave a Reply