Trivial kernel change

Jeffrey Streifling (streje@wwc.edu)
Thu, 31 Dec 1998 21:12:19 -0800 (PST)


I wonder if some kind soul could add a call to show_regs()
when a core dump fails so that there is a good way to figure
out what is causing a userland program to bomb when it
can't leave a core dump. There seems to be at least two
possible places to insert this:
(1) In fs/binfmt_elf.c (and friends if a.out is wanted).
-Advantage: modification one place for all archBs
-Disadvantage: less generality of elf_core_dump()

--- binfmt_elf.c Tue Oct 27 10:23:40 1998
+++ binfmt_elf.c.new Thu Dec 31 20:44:37 1998
@@ -1067,8 +1067,10 @@

if (!current->dumpable ||
limit < ELF_EXEC_PAGESIZE ||
- atomic_read(&current->mm->count) != 1)
+ atomic_read(&current->mm->count) != 1) {
+ show_regs(regs);
return 0;
+ }
current->dumpable = 0;

#ifndef CONFIG_BINFMT_ELF

(2) In arch/i386/kernel/signal.c (and other archs)
-Advantage: customizable, catches any 0-return
-Disadvantage: must be maintained for each arch

--- signal.c Tue Dec 1 11:28:24 1998
+++ signal.c.new Thu Dec 31 20:59:45 1998
@@ -692,6 +692,8 @@
&& current->binfmt->core_dump
&& current->binfmt->core_dump(signr,
regs))
exit_code |= 0x80;
+ else
+ show_regs(regs);
unlock_kernel();
/* FALLTHRU */

Any opinions about which might be better? I'll follow up
with a more complete patch (all archs, cases, formats, as
the case may be) if needed.

I know it's pretty late for 2.2.0, but it seems a bit
trivial for 2.3. Maybe 2.2.1?

Jeffrey Streifling
<streje@wwc.edu>

-
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/