From: Steven Rostedt on
On Thu, 2010-03-18 at 16:26 -0700, Randy Dunlap wrote:
> I can build/boot 2.6.33 with CONFIG_TRACE/TRACING disabled successfully,
> but when I enable lots of tracing config options and then boot with
> ftrace=nop on the kernel command line, I see a GP fault when the parport &
> parport_pc modules are loading/initializing.
>
> It happens in drivers/parport/share.c::parport_register_device(), when that
> function calls try_module_get().
>
> If I comment out the trace_module_get() calls in include/linux/module.h,
> the kernel boots with no problems.
>
> [ 21.852829] general protection fault: 0000 [#1] SMP
> [ 21.856321] last sysfs file: /sys/module/parport/initstate
> [ 21.856321] CPU 0
> [ 21.856321] Pid: 2089, comm: modprobe Not tainted 2.6.33 #11 0HH807/OptiPlex GX620
> [ 21.856321] RIP: 0010:[<ffffffffa0437671>] [<ffffffffa0437671>] parport_register_device+0xe4/0x48c [parport]
> [ 21.856321] RSP: 0018:ffff8800765cba78 EFLAGS: 00010283
> [ 21.856321] RAX: ffff10007b04a3d0 RBX: ffff88007a6a5e30 RCX: 0000000000000000
> [ 21.856321] RDX: 0000000000000000 RSI: ffffffffa043d1de RDI: ffff88007a6a5e30
> [ 21.856321] RBP: ffff8800765cbad8 R08: 0000000000000000 R09: 0000000000000000
> [ 21.856321] R10: ffffffffa043dff8 R11: 0000000000000000 R12: ffffffffa043d1de
> [ 21.856321] R13: ffffffffa043d1de R14: ffffffffa045c940 R15: 0000000000000000
> [ 21.856321] FS: 00007f09cc3fb6f0(0000) GS:ffff880004a00000(0000) knlGS:0000000000000000
> [ 21.856321] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [ 21.856321] CR2: 0000003fb5ad62c0 CR3: 00000000764f6000 CR4: 00000000000006f0
> [ 21.856321] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 21.856321] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [ 21.856321] Process modprobe (pid: 2089, threadinfo ffff8800765ca000, task ffff88007664a3d0)
> [ 21.856321] Stack:


Is this fully reproducible at every boot up? I just booted your config
(no changes) and loaded the parport_pc module with no issues. I even
added your command line (just modifying root=.. )

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Randy Dunlap on
On 03/18/10 19:15, Steven Rostedt wrote:
> On Thu, 2010-03-18 at 16:26 -0700, Randy Dunlap wrote:
>> I can build/boot 2.6.33 with CONFIG_TRACE/TRACING disabled successfully,
>> but when I enable lots of tracing config options and then boot with
>> ftrace=nop on the kernel command line, I see a GP fault when the parport &
>> parport_pc modules are loading/initializing.
>>
>> It happens in drivers/parport/share.c::parport_register_device(), when that
>> function calls try_module_get().
>>
>> If I comment out the trace_module_get() calls in include/linux/module.h,
>> the kernel boots with no problems.
>>
>> [ 21.852829] general protection fault: 0000 [#1] SMP
>> [ 21.856321] last sysfs file: /sys/module/parport/initstate
>> [ 21.856321] CPU 0
>> [ 21.856321] Pid: 2089, comm: modprobe Not tainted 2.6.33 #11 0HH807/OptiPlex GX620
>> [ 21.856321] RIP: 0010:[<ffffffffa0437671>] [<ffffffffa0437671>] parport_register_device+0xe4/0x48c [parport]
>> [ 21.856321] RSP: 0018:ffff8800765cba78 EFLAGS: 00010283
>> [ 21.856321] RAX: ffff10007b04a3d0 RBX: ffff88007a6a5e30 RCX: 0000000000000000
>> [ 21.856321] RDX: 0000000000000000 RSI: ffffffffa043d1de RDI: ffff88007a6a5e30
>> [ 21.856321] RBP: ffff8800765cbad8 R08: 0000000000000000 R09: 0000000000000000
>> [ 21.856321] R10: ffffffffa043dff8 R11: 0000000000000000 R12: ffffffffa043d1de
>> [ 21.856321] R13: ffffffffa043d1de R14: ffffffffa045c940 R15: 0000000000000000
>> [ 21.856321] FS: 00007f09cc3fb6f0(0000) GS:ffff880004a00000(0000) knlGS:0000000000000000
>> [ 21.856321] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
>> [ 21.856321] CR2: 0000003fb5ad62c0 CR3: 00000000764f6000 CR4: 00000000000006f0
>> [ 21.856321] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>> [ 21.856321] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
>> [ 21.856321] Process modprobe (pid: 2089, threadinfo ffff8800765ca000, task ffff88007664a3d0)
>> [ 21.856321] Stack:
>
>
> Is this fully reproducible at every boot up? I just booted your config
> (no changes) and loaded the parport_pc module with no issues. I even
> added your command line (just modifying root=.. )

Yes, it has failed for me 100% of the time (about 10 boots).

I'm rebuilding to test with Mathieu's request now.

--
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Randy Dunlap on
On 03/18/10 17:59, Mathieu Desnoyers wrote:
> * Steven Rostedt (rostedt(a)goodmis.org) wrote:
>> On Thu, 2010-03-18 at 16:26 -0700, Randy Dunlap wrote:
>>> I can build/boot 2.6.33 with CONFIG_TRACE/TRACING disabled successfully,
>>> but when I enable lots of tracing config options and then boot with
>>> ftrace=nop on the kernel command line, I see a GP fault when the parport &
>>> parport_pc modules are loading/initializing.
>>
>> Do you see it without adding the "ftrace=nop"? The only thing that
>> should do is expand the ring buffer on boot up.
>>
>>>
>>> It happens in drivers/parport/share.c::parport_register_device(), when that
>>> function calls try_module_get().
>>>
>>> If I comment out the trace_module_get() calls in include/linux/module.h,
>>> the kernel boots with no problems.
>>
>>
>> Interesting. Well, trace_module_get() is a TRACE_EVENT tracepoint. But
>> should be disabled here. It may be something to do with DEFINE_TRACE.
>>
>> (added Mathieu to Cc since he wrote that code)
>
> can you try replacing the "local_read(__module_ref_addr(module, cpu))" argument
> with "0" ?

Yes, that boots with no problems.

> Arguments with side-effects are not skipped by the jump over disabled
> instrumentation. This is why we should do that part within the probe declaration
> in the TRACE_EVENT macros.
>
> But if we find out that the problem really is this argument, then it should be
> fixed, because something would be wrong with it (just moving it to TRACE_EVENT
> is not a proper solution).
>
> Thanks,
>
> Mathieu


--
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Mathieu Desnoyers on
* Randy Dunlap (randy.dunlap(a)oracle.com) wrote:
> On 03/18/10 17:59, Mathieu Desnoyers wrote:
> > * Steven Rostedt (rostedt(a)goodmis.org) wrote:
> >> On Thu, 2010-03-18 at 16:26 -0700, Randy Dunlap wrote:
> >>> I can build/boot 2.6.33 with CONFIG_TRACE/TRACING disabled successfully,
> >>> but when I enable lots of tracing config options and then boot with
> >>> ftrace=nop on the kernel command line, I see a GP fault when the parport &
> >>> parport_pc modules are loading/initializing.
> >>
> >> Do you see it without adding the "ftrace=nop"? The only thing that
> >> should do is expand the ring buffer on boot up.
> >>
> >>>
> >>> It happens in drivers/parport/share.c::parport_register_device(), when that
> >>> function calls try_module_get().
> >>>
> >>> If I comment out the trace_module_get() calls in include/linux/module.h,
> >>> the kernel boots with no problems.
> >>
> >>
> >> Interesting. Well, trace_module_get() is a TRACE_EVENT tracepoint. But
> >> should be disabled here. It may be something to do with DEFINE_TRACE.
> >>
> >> (added Mathieu to Cc since he wrote that code)
> >
> > can you try replacing the "local_read(__module_ref_addr(module, cpu))" argument
> > with "0" ?
>
> Yes, that boots with no problems.

clickety-clicketa... git blame include/linux/module.h :

commit 7ead8b8313d92b3a69a1a61b0dcbc4cd66c960dc
Author: Li Zefan <lizf(a)cn.fujitsu.com>
Date: Mon Aug 17 16:56:28 2009 +0800

tracing/events: Add module tracepoints

(Adding Li Zefan in CC)

Two things:

1) In this commit, most of the tracepoints contain argument with side-effects.
These do not belong there; they should be moved into TRACE_EVENT macros.

2) There seem to be a null-pointer bug with
local_read(__module_ref_addr(module, cpu)) in try_module_get(). This should
be investigated even if we move the argument to TRACE_EVENT.

Thanks,

Mathieu

>
> > Arguments with side-effects are not skipped by the jump over disabled
> > instrumentation. This is why we should do that part within the probe declaration
> > in the TRACE_EVENT macros.
> >
> > But if we find out that the problem really is this argument, then it should be
> > fixed, because something would be wrong with it (just moving it to TRACE_EVENT
> > is not a proper solution).
> >
> > Thanks,
> >
> > Mathieu
>
>
> --
> ~Randy

--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Randy Dunlap on
On 03/18/10 16:55, Steven Rostedt wrote:
> On Thu, 2010-03-18 at 16:26 -0700, Randy Dunlap wrote:
>> I can build/boot 2.6.33 with CONFIG_TRACE/TRACING disabled successfully,
>> but when I enable lots of tracing config options and then boot with
>> ftrace=nop on the kernel command line, I see a GP fault when the parport &
>> parport_pc modules are loading/initializing.
>
> Do you see it without adding the "ftrace=nop"? The only thing that
> should do is expand the ring buffer on boot up.

Yes, it happens with or without "ftrace=nop" as a kernel boot argument.


>>
>> It happens in drivers/parport/share.c::parport_register_device(), when that
>> function calls try_module_get().
>>
>> If I comment out the trace_module_get() calls in include/linux/module.h,
>> the kernel boots with no problems.
>
>
> Interesting. Well, trace_module_get() is a TRACE_EVENT tracepoint. But
> should be disabled here. It may be something to do with DEFINE_TRACE.
>
> (added Mathieu to Cc since he wrote that code)


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