sanctimonious
asked on
I want my core dumps
I've got a server program running on Linux (kernel 2.6.13 x86_64), and my problem is that when the program catches SIGSEGV (segmentation fault) and then reacts to it by calling abort(), no core dump is written. There's no limit on core file size, and since server programs are pain in the behind to debug, I'd rather like to see what the dump has to say. How can I ensure that the dump is written properly (or inproperly in the case the system is for some reason "supposed" to not write a core dump)?
[root ~]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 32251
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 32251
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root ~]# ls -la .
drwxrwx-w- 3 root root 83 May 17 13:48 .
[root ~]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 32251
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 32251
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root ~]# ls -la .
drwxrwx-w- 3 root root 83 May 17 13:48 .
You might want to use a serial console to catch the oops message.
One reason it can't write a core dump is if the program CAN'T write a file there (for example, on NFS mounts which don't allow root rights).
Can you generate the problem at will? I guess hit it with a kill -SIGSEGV.
You may want to hook it up to strace when you're doing this...also look at the current directory
(and see if it is writable and exists).
Can you generate the problem at will? I guess hit it with a kill -SIGSEGV.
You may want to hook it up to strace when you're doing this...also look at the current directory
(and see if it is writable and exists).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You, sir, are a scholar and a gentleman. Prctl() was right on the money.