Commit eb2d73fc authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix exception trace printing on x86-64

From: Andi Kleen <ak@suse.de>

Originally by Juergen Kreileder, changed by me.

The test for unhandled signals was wrong.  Correct it.  This helps Java
users, who would see bogus printks in their kernel logs previously.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 848f12d6
......@@ -211,7 +211,8 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
int unhandled_signal(struct task_struct *tsk, int sig)
{
/* Warn for strace, but not for gdb */
if ((tsk->ptrace & (PT_PTRACED|PT_TRACESYSGOOD)) == PT_PTRACED)
if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) &&
(tsk->ptrace & PT_PTRACED))
return 0;
return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
(tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
......@@ -374,7 +375,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
(address >> 32))
return;
if (exception_trace && !unhandled_signal(tsk, SIGSEGV)) {
if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
printk(KERN_INFO
"%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
tsk->comm, tsk->pid, address, regs->rip,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment