I am using Ubuntu 12.04 LTS. I wrote a simple program as follows to create crash
// null.c
#include<stdio.h>
int main()
{
int *p = NULL;
int k=*p;
printf("%d",sizeof(0));
return 0;
}
Now I run with "gcc -g null.c" and then "./a.out" and the output is as expected.
Segmentation fault (core dumped)
Now I want to see the core dump file using gdb. I did the following things
I want to create the core dump in my current directory. What to do now?
Your real question appears to be not "where is my core dump", but rather "how can I modify /proc/sys/kernel/core_pattern
".
sudo bash -c 'echo core.%e.%p > /proc/sys/kernel/core_pattern'
should do the trick.
You need to adjust your core dump size limit with following command:
ulimit -S -c maximum-core-dump-size
The the value is given in Kb.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With