Re: [mm patch] oprofile: backtrace operation does not initialized

From: Akinobu Mita
Date: Thu Dec 09 2004 - 09:23:25 EST


On Thursday 09 December 2004 10:50, Greg Banks wrote:
> On Thu, Dec 09, 2004 at 01:46:22AM +0000, John Levon wrote:
> > On Thu, Dec 09, 2004 at 11:39:06AM +1100, Greg Banks wrote:
> > > But for now I don't see any drama with leaving in the ->setup() and
> > > ->shutdown() methods when rewriting the ops structure. Ditto for
> > > the ->create_files() methods.
> >
> > Wouldn't this mean that we try to set up the NMI stuff regardless of
> > forcing the timer ? I can imagine a flaky system where somebody needs to
> > avoid going near that stuff.
> >
> > timer_init() making sure to set all fields seems reasonable to me. Or
> > oprofile_init() could grab ->backtrace, memset the structure, then
> > replace ->backtrace...
>
> Ok, how about this patch?

Thanks, but..

This patch is broken on several architectures (sparc64, sh, parisc, s390).
Even though i386 without CONFIG_X86_LOCAL_APIC and CONFIG_X86_IO_APIC.

Since the timer interrupt is the only way of getting sampling for oprofile
on such environments. if no module parameters specified (i.e. timer == 0),
then oprofile_timer_init() is never called. and I have got this error:


Unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip:
e81a97b0
*pde = 0b690001
Oops: 0000 [#1]
PREEMPT DEBUG_PAGEALLOC
Modules linked in: oprofile 3c59x microcode ntfs video
CPU: 0
EIP: 0060:[<e81a97b0>] Not tainted VLI
EFLAGS: 00010246 (2.6.10-rc2-mm4)
EIP is at oprofilefs_str_to_user+0x10/0x2c [oprofile]
eax: 00000000 ebx: 00000000 ecx: ffffffff edx: 00000000
esi: c7169f54 edi: 00000000 ebp: c7616f6c esp: c7616f68
ds: 007b es: 007b ss: 0068
Process cat (pid: 3366, threadinfo=c7616000 task=c716da60)
Stack: c7616fa8 c7616f90 c0171a80 00000000 0804d888 00001000 c7616fa8 c7169f54
fffffff7 0804d888 c7616fbc c0171cfe c7169f54 0804d888 00001000 c7616fa8
00000000 00000000 00000000 00000003 00001000 c7616000 c0103d41 00000003
Call Trace:
[<c0104397>] show_stack+0x6f/0x88
[<c01044c6>] show_registers+0xfe/0x160
[<c01046f1>] die+0x13d/0x288
[<c0112c74>] do_page_fault+0x324/0x6a1
[<c0103f3b>] error_code+0x2b/0x30
[<c0171a80>] vfs_read+0x88/0x104
[<c0171cfe>] sys_read+0x3a/0x64
[<c0103d41>] sysenter_past_esp+0x52/0x71
Code: 53 58 89 43 54 89 43 4c 89 53 50 89 43 44 89 53 48 89 d8 8b 5d fc c9 c3 8d 76 00 55 89 e5 8b 55 08 57 31 c0 b9 ff ff ff ff 89 d7 <f2> ae f7 d1 49 51 52 ff 75 14 ff 75 10 ff 75 0c e8 97 70 ff d7




-
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/