I want my core dumps

Posted on 2006-05-18
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 .
Question by:sanctimonious
    LVL 1

    Expert Comment

    You might want to use a serial console to catch the oops message.
    LVL 3

    Expert Comment

    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).
    LVL 43

    Accepted Solution

    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)

    Author Comment

    You, sir, are a scholar and a gentleman. Prctl() was right on the money.

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Debian 3.16.7 3 113
    OS & DB Recommendation 4 43
    Linux 10 103
    Identify Linux loader 67 151
    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…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now