Core dump

From Useful Things
Revision as of 14:27, 17 October 2014 by Milosivanovic (talk | contribs) (Created page with "= Enabling core dumps = The core file size is 0 by default, which results in no core being generated: <pre> sh# ulimit -a core file size (blocks, -c) 0 ... ... ... </...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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