Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SIGABRT how to get the coredump file?

Tags:

linux

I wrote a sample program with kill(pid, SIGABRT), but the process which receives SIGABRT does not create any core dump. How can I get the core dump file by sending SIGABRT signal?

like image 564
user504542 Avatar asked Nov 11 '10 13:11

user504542


2 Answers

yes set the core dump file limit as unlimited by using

ulimit -c unlimited

And also check the path of core dump generation, normally the core dump is generated in the current directory of the process but by giving the path in /proc/sys/kernel/core_pattern you can change the path and name of core generation, something like below

echo /var/log/mycore >  /proc/sys/kernel/core_pattern

now the core would be generated as /var/log/mycore.pid.

Please also refer the man core, if you still don't see the core then send us the output of below command

cat /proc/sys/kernel/core_pattern

You can also have a look in http://yusufonlinux.blogspot.com/2010/11/debugging-core-using-gdb.html

like image 95
Yusuf Khan Avatar answered Oct 12 '22 23:10

Yusuf Khan


You need to set the core dump ulimit to something above zero before running the process that you want to abort:

ulimit -c unlimited
like image 25
caf Avatar answered Oct 12 '22 23:10

caf