?
Solved

I want my core dumps

Posted on 2006-05-18
4
Medium Priority
?
789 Views
Last Modified: 2008-02-01
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 .
0
Comment
Question by:sanctimonious
4 Comments
 
LVL 1

Expert Comment

by:jainrah
ID: 16709858
You might want to use a serial console to catch the oops message.
0
 
LVL 3

Expert Comment

by:leisner
ID: 16715149
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).
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 2000 total points
ID: 16715646
man prctl # flag PR_SET_DUMPABLE
and make sure current working directory for process is writeable by euid of the process.
Also check out /proc/sys/kernel/core_pattern (it may use pattern reffering another directory, which is unwriteable for process)
0
 

Author Comment

by:sanctimonious
ID: 16716920
You, sir, are a scholar and a gentleman. Prctl() was right on the money.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question