Enable core dumping
I would like to enable core dumping. I have a program even though I have down this delibrately to cause a core dump. I don't get any core dump file in my current directory.
I am compiling on kubuntu 8.10 linux 2.6.24.
int *ptrInt = 1000;
printf("*ptrInt %d", *ptrInt);
I thought when you compile with the switch -g that would create a core dump file?
I am using gcc -g example.c -o example
Make sure core dumping is actually enabled. Type "ulimit -c unlimited" to enable it.
Also, apport, if installed, might be catching those crashes. If there is a file /etc/default/apport, edit it and change the "enabled" field to 0.
I didn't need to change anything in the apport file. It was already set correctly.
However, when I used this ulimit -c 20. I don't want unlimited. I was still in the etc/default directory. The core dump didn't happen.
However, I went to the current directory that my program is in, and executed the ulimit -c 20. The program left a core dump file.
Does this mean that the ulimit -c always has to be done in the current directory that you have you program?
No, it means you don't have permission to write files in /etc/default.
Also, limiting the core file size might make it unusable.