A core file is a memory image of a crashed process. With a debugger you can find out the possible causes of the crash. If you don't know what to do with a core file (except rm core
), you can request not to generate them with limit coredumpsize 0
.
A segmentation fault is one of the manifestations of a process crash. Usually it arises when the program tries to access memory that it shouldn't.
There are amny causes of segmentation fault. here is a non-exhaustive list:
- access to data through an uninitialized pointer
- access to malloc'ed memory which has been free'd
- access to array elements beyond the array size
- ...
Tools exist for detecting such memory bad access. purify or lint are example of these.