1. Remove the limitation of dump
ulimit -c unlimited
2. Indicate system to dump a core
touch /.init_enable_core
3. Set the path of dumped core
sysctl -w "kernel.core_pattern=/tmp/%e.%p.%s.%t.core"
These message would show on crash of process:
Segmentation fault (core dumped) root@XXX:~# ls /tmp/*.core demo_crash.5486.11.1470130615.core