{
char *ptr = NULL;
*ptr = 'A'; // This will cause a segmentation fault
return 0;
}
root@A9x28:/# ulimit -a | grep core
-c: core file size (blocks) unlimited
root@A9x28:/# sysctl -a
fs.suid_dumpable = 2
kernel.core_pattern = /data/core
root@A9x28:/# cat /proc/sys/kernel/core_pattern
/data/core
root@A9x28:/# ./create_coredump
Segmentation fault (core dumped)
沒有留言:
張貼留言