when I ran a program which will cause the segmentation fault as root user , the core is not dumped.. I checked the ulimit -c and it is unlimited...But if I ran as a normal user the program is dumping the core..
suresh@suresh-desktop:~$ ulimit -c
unlimited
suresh@suresh-desktop:~$ ./main
Segmentation fault (core dumped)
suresh@suresh-desktop:~$ sudo ./main
Segmentation fault
suresh@suresh-desktop:~$
root@suresh-desktop:~# ulimit -c unlimited
root@suresh-desktop:~# ./main
Segmentation fault
//main.c
main()
{
*((int *)0xb80000) = 123;
}
root@suresh-desktop:~# ulimit -a -S
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
root@suresh-desktop:~# ulimit -a -H
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited