diff options
author | Olof Johansson <olof@lixom.net> | 2007-10-11 20:20:07 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-12 00:05:18 -0400 |
commit | d0c3d534a4388a465101b634a95f2ec586415254 (patch) | |
tree | e6acdc89adcb9057b7bbaeba55332fdcb97c2ceb /arch/powerpc/kernel/signal_64.c | |
parent | b63db45ca44a805ef21eb10a3750e88419156423 (diff) |
[POWERPC] Implement logging of unhandled signals
Implement show_unhandled_signals sysctl + support to print when a process
is killed due to unhandled signals just as i386 and x86_64 does.
Default to having it off, unlike x86 that defaults on.
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/signal_64.c')
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index de895e6d8c62..faeb8f207ea4 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -64,6 +64,11 @@ struct rt_sigframe { | |||
64 | char abigap[288]; | 64 | char abigap[288]; |
65 | } __attribute__ ((aligned (16))); | 65 | } __attribute__ ((aligned (16))); |
66 | 66 | ||
67 | static const char fmt32[] = KERN_INFO \ | ||
68 | "%s[%d]: bad frame in %s: %08lx nip %08lx lr %08lx\n"; | ||
69 | static const char fmt64[] = KERN_INFO \ | ||
70 | "%s[%d]: bad frame in %s: %016lx nip %016lx lr %016lx\n"; | ||
71 | |||
67 | /* | 72 | /* |
68 | * Set up the sigcontext for the signal frame. | 73 | * Set up the sigcontext for the signal frame. |
69 | */ | 74 | */ |
@@ -315,6 +320,11 @@ badframe: | |||
315 | printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n", | 320 | printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n", |
316 | regs, uc, &uc->uc_mcontext); | 321 | regs, uc, &uc->uc_mcontext); |
317 | #endif | 322 | #endif |
323 | if (show_unhandled_signals && printk_ratelimit()) | ||
324 | printk(regs->msr & MSR_SF ? fmt64 : fmt32, | ||
325 | current->comm, current->pid, "rt_sigreturn", | ||
326 | (long)uc, regs->nip, regs->link); | ||
327 | |||
318 | force_sig(SIGSEGV, current); | 328 | force_sig(SIGSEGV, current); |
319 | return 0; | 329 | return 0; |
320 | } | 330 | } |
@@ -398,6 +408,11 @@ badframe: | |||
398 | printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n", | 408 | printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n", |
399 | regs, frame, newsp); | 409 | regs, frame, newsp); |
400 | #endif | 410 | #endif |
411 | if (show_unhandled_signals && printk_ratelimit()) | ||
412 | printk(regs->msr & MSR_SF ? fmt64 : fmt32, | ||
413 | current->comm, current->pid, "setup_rt_frame", | ||
414 | (long)frame, regs->nip, regs->link); | ||
415 | |||
401 | force_sigsegv(signr, current); | 416 | force_sigsegv(signr, current); |
402 | return 0; | 417 | return 0; |
403 | } | 418 | } |