Question about Kernel Reporting Sigfaults in <arch>/mm/fault.c

From: Sean Kamath
Date: Thu Jul 06 2006 - 18:25:01 EST


Hi.

[All lines are from 2.6.16's latest git repository from kernel.org.]

We recently started noticing error messages showing up in the messages file
every time a user process segfaulted. Doing some investigation, it turns
out it's only on x86_64 boxen (the other boxes are i386). We traced this
down to arch/x86_64/mm/fault.c:do_page_fault() (under bad_area_nosemaphore):

478 if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
479 printk(
480 "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
481 tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
482 tsk->comm, tsk->pid, address, regs->rip,
483 regs->rsp, error_code);
484 }

exception_trace is set to 1 (line 296) and not used anywhere else in the file.

arch/i386/mm/fault.c does not have this.
arch/sparc64/mm/fault.c does not have this.

Oddly, sparc/mm/fault.c *does* have (a version of) this, only ifdef'ed out:

319 #if 0
320 printk("Fault whee %s [%d]: segfaults at %08lx pc=%08lx\n",
321 tsk->comm, tsk->pid, address, regs->pc);
322 #endif

This leads me to suspect that the segfault reporting in in x86_64 is
vestigial from a time when it was helpful.

The question(s): Is this intentional (to have segfaults reported on x86_64,
and (possibly) nothing else)? Or was "exception_trace" supposed to be a
flag but never fleshed out?

I admit, it would be nice to be able to toggle on and off segfault
reporting in the kernel (from a system administration point of view, this
is helpful to be able to go back to developers and say 'your program is
crashing a lot' -- something necessary if you are protecting end-users from
a lot of core files . . .) on all platforms.

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