Linux man page defines code dump as a disk file containing an image of process's memory at the time of termination. Core dump is result of some signals which causes a process to terminate and produce core dump file.
Signals:
- SIGQUIT - Quit from keyboard (Is this due to CLT-C?)
- SIGILL - Illegal instruction
- SIGABRT - Abort signal
- SIGFPE - Floating point exception
- SIGSEGV - Invalid memory reference
- SIGBUS - Bus error
ulimit -c unlimited
The above command will change the size of core dump file to unlimited.
By default the name of core dump file is "core". This can be configured in kernels 2.4.21 and beyond. A template can be defined in file /proc/sys/kernel/core_pattern to name the core dump file suitably.
Kernel 2.6.19 and onwards piping the core dump file to a program is possible. The file /proc/sys/kernel/core_pattern should contain pipe symbol "|" as its first character then the rest of the line is interpreted as program to be execute on core dump.
Kernel 2.6.23 and onwards lets the user to configure which memory segment are written on core dump file. The following bit mask should be defined in file /proc/PID/coredump_filter (0x3 is default value).
bit 0 Dump anonymous private mappings
bit 1 Dump anonymous shared mappings
bit 2 Dump file-backed private mappings
bit 3 Dump file-backed shared mappings
If a bit in the bit mask is set the corresponding memory is dumped.
Detailed explanation can be found in core dump man page.
No comments:
Post a Comment