Core dump

From Useful Things
Jump to: navigation, search

Enabling core dumps

The core file size is 0 by default, which results in no core being generated:

sh# ulimit -a
core file size          (blocks, -c) 0
...
...
...

Set it to unlimited:

sh# ulimit -c unlimited
sh# ulimit -a
core file size          (blocks, -c) unlimited
...
...
...

Ensure that the core is written to a writeable area of the system, such as /tmp, by modifying the value of /proc/sys/kernel/core_pattern:

echo "/tmp/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern

%e program name
%p pid
%h hostname
%t timestamp