Force a process to coredump


Ensure “gdb” is installed.

Example to force running "crond" process to coredump.

[root@centos ~]# gcore $(pidof crond)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f8c0f444ee0 in __nanosleep_nocancel () from /lib64/libc.so.6
warning: target file /proc/7011/cmdline contained unexpected null characters
Saved corefile core.7011
[root@centos ~]# ls
core.7011
[root@centos ~]# file core.7011 
core.7011: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from '/usr/sbin/crond'

No comments: