SIGABRT how to get coredump file?

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

+6
linux
source share
2 answers

yes set the maximum kernel dump file size to unlimited using

 ulimit -c unlimited 

And also check the path for generating a kernel dump, usually a kernel dump is generated in the current directory of the process, but by specifying the path in /proc/sys/kernel/core_pattern , you can change the path and name of the kernel generation, something like below

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

Now the kernel will be generated as /var/log/mycore.pid .

Please also indicate the key core of the person, if you still do not see the core, then send us the command below the command

 cat /proc/sys/kernel/core_pattern 

You can also see http://yusufonlinux.blogspot.com/2010/11/debugging-core-using-gdb.html

+7
source share

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

 ulimit -c unlimited 
+6
source share

All Articles