Messages in this thread Patch in this message | | | Date | Tue, 14 Mar 2000 21:26:34 -0800 (PST) | From | Patrick Wildi <> | Subject | core 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(¤t->mm->count) != 1) + test_and_set_bit(31, ¤t->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/
| |