lkml.org 
[lkml]   [2000]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectcore dump for multithreaded apps (2.2 kernels)
Hello,

I have been frustrated by the way core dumps work for
multithreaded applications under linux (2.2 series).
Instead of dummping the process that caused the
exception, the current implementation dumps the
last one to exit. Unfortunatley that one is useless
in getting any traceback off where the exception
happened.

The patch below changes the behaviour and dumps
the first one (the one causing the exception).
I am "abusing" a reserved bit in mm->def_flags.

This patch seems to work for me. But I would
welcome feedback.

Patrick


diff -u linux-2.2.13/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- linux-2.2.13/fs/binfmt_elf.c Sun Jun 13 10:50:04 1999
+++ linux/fs/binfmt_elf.c Tue Mar 14 15:13:42 2000
@@ -1073,7 +1073,7 @@

if (!current->dumpable ||
limit < ELF_EXEC_PAGESIZE ||
- atomic_read(&current->mm->count) != 1)
+ test_and_set_bit(31, &current->mm->def_flags) != 0)
return 0;
current->dumpable = 0;




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.023 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site