Core files capture the state of a failing program at the point that it terminates. You don't even have to be in the room with a debugger when the bug manifests itself. So when you see
Segmentation fault (core dumped), don't shrug; investigate the core file and extract the goldmine of information in there.
The first observation is that core files are not created by default, but only when the core file resource limit for the process is non-zero. You can change it for the current shell using
ulimit -c. To remove all limits on the size of core files, type the following:
$ ulimit -c unlimited
By default, the core file is named
core and is placed in the current working directory of the process, which is the one pointed to by