lkml.org 
[lkml]   [2006]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 1/3] vdso: print fatal signals
Ingo Molnar wrote:
> Index: linux-vdso-rand.q/kernel/signal.c
> ===================================================================
> --- linux-vdso-rand.q.orig/kernel/signal.c
> +++ linux-vdso-rand.q/kernel/signal.c
> @@ -763,6 +763,37 @@ out_set:
> #define LEGACY_QUEUE(sigptr, sig) \
> (((sig) < SIGRTMIN) && sigismember(&(sigptr)->signal, (sig)))
>
> +int print_fatal_signals = 0;
> +
> +static void print_fatal_signal(struct pt_regs *regs, int signr)
> +{
> + printk("%s/%d: potentially unexpected fatal signal %d.\n",
> + current->comm, current->pid, signr);
> +
> +#ifdef __i386__
> + printk("code at %08lx: ", regs->eip);
> + {
> + int i;
> + for (i = 0; i < 16; i++) {
> + unsigned char insn;
> +
> + __get_user(insn, (unsigned char *)(regs->eip + i));
> + printk("%02x ", insn);
> + }
> + }
> +#endif
>


This looks ok for debugging boot problems. Perhaps you could print the
registers too? The instruction dump won't help much for indirect access.

The get_user of eip+i is ok, but doesn't account for segment offsets.
Not that I think it needs to here. But it is one of a many growing
number of places that now try to inspect or modify a potentially
segmented area of memory (page fault handler must inspect for prefetch
instructions, kprobes reads and patches code, FPU emulation). Perhaps a
common interface would be a nice thing at some point in time.

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

\
 
 \ /
  Last update: 2006-05-24 00:13    [W:0.034 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site