aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/traps_32.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2008-01-30 07:33:18 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:18 -0500
commit03252919b79891063cf99145612360efbdf9500b (patch)
treea80dc0c89448308d75d247446a5a04c84cb708a6 /arch/x86/kernel/traps_32.c
parentd3432896dae72ee97deb850ad7bbc30329d32c0d (diff)
x86: print which shared library/executable faulted in segfault etc. messages v3
They now look like: hal-resmgr[13791]: segfault at 3c rip 2b9c8caec182 rsp 7fff1e825d30 error 4 in libacl.so.1.1.0[2b9c8caea000+6000] This makes it easier to pinpoint bugs to specific libraries. And printing the offset into a mapping also always allows to find the correct fault point in a library even with randomized mappings. Previously there was no way to actually find the correct code address inside the randomized mapping. Relies on earlier patch to shorten the printk formats. They are often now longer than 80 characters, but I think that's worth it. [includes fix from Eric Dumazet to check d_path error value] Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/traps_32.c')
-rw-r--r--arch/x86/kernel/traps_32.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 6f3bb287c702..270cfd483160 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -609,11 +609,14 @@ void __kprobes do_general_protection(struct pt_regs * regs,
609 current->thread.error_code = error_code; 609 current->thread.error_code = error_code;
610 current->thread.trap_no = 13; 610 current->thread.trap_no = 13;
611 if (show_unhandled_signals && unhandled_signal(current, SIGSEGV) && 611 if (show_unhandled_signals && unhandled_signal(current, SIGSEGV) &&
612 printk_ratelimit()) 612 printk_ratelimit()) {
613 printk(KERN_INFO 613 printk(KERN_INFO
614 "%s[%d] general protection ip:%lx sp:%lx error:%lx\n", 614 "%s[%d] general protection ip:%lx sp:%lx error:%lx",
615 current->comm, task_pid_nr(current), 615 current->comm, task_pid_nr(current),
616 regs->ip, regs->sp, error_code); 616 regs->ip, regs->sp, error_code);
617 print_vma_addr(" in ", regs->ip);
618 printk("\n");
619 }
617 620
618 force_sig(SIGSEGV, current); 621 force_sig(SIGSEGV, current);
619 return; 622 return;