This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Coredumps and pthreads on Linux w/glibc?


On Tue, 4 Apr 2000, George T. Talbot wrote:

> Date: Tue, 04 Apr 2000 14:45:40 -0400
> From: George T. Talbot <george@moberg.com>
> To: libc-alpha@sourceware.cygnus.com
> Subject: Coredumps and pthreads on Linux w/glibc?
> 
> I'm running glibc 2.1.3 on x86 Linux (Kernel 2.2.14 SMP).  Can anyone tell me
> why this program will not dump core when it segfaults?  I've set ulimit -c
> unlimited, and if I comment-out pthread_create(), the program will dump core.


The ELF coredump logic in the kernel prevents this. What happens is that
the kernel checks the reference count on the memory map of the thread.
It only generates a core dump if the reference count is 1.

Thus in order to get a core dump from a LinuxThreads application, a thread
which received the core-generating signal must pass through the core dump
function after all other threads have released their memory maps.

So basically, whether you get a core dump or not is the result of a lottery.

You can patch your kernel to defeat this check.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]