Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating core dumps on Linux

Duplicate:

generate a core dump in linux

I am trying to create a core dump in my "Fedora Core release 3 (Heidelberg)".

[root@testserver test_core_dump]# uname -a

Linux testserver 2.6.12-1.1381_FC3 #1 Fri Oct 21 03:46:55 EDT 2005 i686 athlon i386 GNU/Linux

I am following this to create core dumps.

The problem is, /proc/sys/kernel/suid_dumpable is not present in this version. I also checked here /proc/sys/fs/suid_dumpable, but suid_dumpable is not present.

1) Is there any work around for this? 2) Am I missing something here?

like image 963
Manohar Avatar asked Dec 03 '22 08:12

Manohar


1 Answers

The instructions you are following are simply to over-ride the o/s limits that may prevent you from getting a core dump.

The generation of a core dump is a trivial process, you send a signal to the process as follows

kill -ABRT pid_of_process

There are many things however that may prevent this from happening, however you should try this first and see if it produces a core dump in your current directory. If the program is interactive and doesn't trap the quit signnal then you may be able to cause core to dump by sending SIGQUIT to the process, this is usually bound to CTRL-\

The area you are having problems with in the referenced document refers to process that run setuid/setguid if your process is not running in either of those modes then you can safely ignore that step. (You can tell if the process is running setuid/setguid by looking at the file permissions of the program and examining the setuid and setguid bits this can be done by issuing an ls -l command and looking for s in the 4th position (setuid) or 7th position (setgid) (example of setuid below)

-r-sr-xr-x 1 root wheel 57616 28 Oct 03:28 /usr/bin/login

Have you tried to generate a core without using the step that is not working and did it work?

You will need to be able to write in the directory that the process is running in, or the directory defined for core dumps if that is not the current directory. Running as root may solve the permissions issues.

like image 156
Steve Weet Avatar answered Dec 20 '22 03:12

Steve Weet