Re: core dumps from multi-threaded (kernel cloned) processes

kwrohrer@enteract.com
Fri, 14 Nov 1997 11:42:38 -0600 (CST)


And lo, Philip Gladstone saith unto me:
> The current behaviour of Linux 2.0.x (and I think 2.1.x) when
> a glibc multithreaded process crashes is not useful. [The
> multithreading is implemented by means of cloning]. Linux
> dumps (essentially) the initial thread rather than the crashing
> thread. Why?
[snip]
> I'm note sure what the right approach to fix this is. My inclination
> would be to stop all the other processes (those which share the mmap),
> and generate a threaded core dump. Then mark all these processes as
> not dumpable, and then continue them. This is somewhat broken,
> but I don't know what the right approach is.
A refinement: assuming that you dump the register contents, stack
pointer included, for all the threads in the core created by the dying
thread, there's no reason to mark the others non-dumpable, assuming they
survive the experience. If one were to dump to "core.%d",pid_of_dead_thread,
instead of just to "core", that would be another reason not to mark the
other threads non-dumpable. Or, kill the whole heavyweight process
after dumping core from the perspective of the crashed thread.

Keith