From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Jaswinder Singh Rajput <jaswinder@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
x86 maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: oops in tracepoint_update_probe_range() (was: Re: [oops -tip] : x86 AMD 64)
Date: Wed, 18 Mar 2009 18:33:48 +0100 [thread overview]
Message-ID: <20090318173347.GD5981@nowhere> (raw)
In-Reply-To: <20090318172750.GA13584@elte.hu>
On Wed, Mar 18, 2009 at 06:27:50PM +0100, Ingo Molnar wrote:
>
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
> > On Wed, Mar 18, 2009 at 10:18:56PM +0530, Jaswinder Singh Rajput wrote:
> > > On Wed, 2009-03-18 at 17:35 +0100, Ingo Molnar wrote:
> > > > * Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
> > > >
> > > > > Good: f4c3c4cdb1de232
> > > > > Bad : 1e08816af0bc345
> > > > >
> > > > > Config:
> > > > > http://userweb.kernel.org/~jaswinder/oops_20090318/config-hpdv5-tip-bad-20090318
> > > > >
> > > > > oops:
> > > > > http://userweb.kernel.org/~jaswinder/oops_20090318/oops_page1.jpg
> > > > > http://userweb.kernel.org/~jaswinder/oops_20090318/oops_page2.jpg
> > > > > http://userweb.kernel.org/~jaswinder/oops_20090318/oops_page3.jpg
> > > > > http://userweb.kernel.org/~jaswinder/oops_20090318/oops_page4.jpg
> > > > >
> > > > > <freeze>
> > > >
> > > > Steve, Frederic - the crashes above are in:
> > > >
> > > > tracepoint_update_probe_range()
> > > >
> > > > in a modular kernel apparently.
> > > >
> > >
> > > This fixed the oops for me, Is this looks OK to you:
> > >
> > > Subject: [PATCH] x86: tracepoint.c fix oops
> > >
> > > BUG: unable to handle kernel NULL pointer dereference at (null)
> > > IP: [<ffffffff8107d4de>] tracepoint_update_probe_range+0x1f/0x9b
> > > PGD 13d5fb067 PUD 13d688067 PMD 0
> > > Oops: 0000 [#1] SMP
> > >
> > > Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> > > ---
> > > kernel/tracepoint.c | 3 +++
> > > 1 files changed, 3 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
> > > index 7960274..80d1353 100644
> > > --- a/kernel/tracepoint.c
> > > +++ b/kernel/tracepoint.c
> > > @@ -280,6 +280,8 @@ void tracepoint_update_probe_range(struct tracepoint *begin,
> > >
> > > mutex_lock(&tracepoints_mutex);
> > > for (iter = begin; iter < end; iter++) {
> > > + if (!iter)
> > > + goto out;
> > > mark_entry = get_tracepoint(iter->name);
> > > if (mark_entry) {
> > > set_tracepoint(&mark_entry, iter,
> > > @@ -288,6 +290,7 @@ void tracepoint_update_probe_range(struct tracepoint *begin,
> > > disable_tracepoint(iter);
> > > }
> > > }
> > > +out:
> > > mutex_unlock(&tracepoints_mutex);
> > > }
> >
> >
> > Ok, it should fix the crash.
> > But I think the real problem remains: iter is not supposed to point to NULL,
> > this is a section range:
> >
> > tracepoint_update_probe_range(__start___tracepoints,
> > __stop___tracepoints);
> >
> > It seems to mean that the section is empty.
>
> OK - so checking for !iter on entry and emitting a WARN_ONCE in that
> case ought to change the crash for a warning, right?
>
> Ingo
The real bug is elsewhere, Jaswinder has one user of tracepoints
which is blktrace.
So this section is not supposed to be empty.
But, I guess it is possible to raise via a randconfig by enabling
CONFIG_TRACEPOINTS without any user of it because when a module
is loaded, the section is checked without the !NULL safety.
Thus I think Jaswinder's patch could be picked without WARN or anything,
because this situation can happen in a normal randconfig case.
Concerning the real bug (there is blktrace here, so this NULL is weird)
I'm building Jaswinder's config, may be I will find something...
next prev parent reply other threads:[~2009-03-18 17:34 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 16:23 [oops -tip] : x86 AMD 64 Jaswinder Singh Rajput
2009-03-18 16:35 ` oops in tracepoint_update_probe_range() (was: Re: [oops -tip] : x86 AMD 64) Ingo Molnar
2009-03-18 16:41 ` Frederic Weisbecker
2009-03-18 16:48 ` Jaswinder Singh Rajput
2009-03-18 16:54 ` Ingo Molnar
2009-03-18 16:56 ` Frederic Weisbecker
2009-03-18 17:27 ` Ingo Molnar
2009-03-18 17:33 ` Frederic Weisbecker [this message]
2009-03-18 17:33 ` [tip:tracing/ftrace] tracing: fix oops in tracepoint_update_probe_range() Jaswinder Singh Rajput
2009-03-18 17:38 ` Jaswinder Singh Rajput
2009-03-18 17:52 ` Jaswinder Singh Rajput
2009-03-18 17:51 ` Jaswinder Singh Rajput
2009-03-18 17:56 ` Jaswinder Singh Rajput
2009-03-18 18:00 ` Frederic Weisbecker
2009-03-18 18:12 ` Jaswinder Singh Rajput
2009-03-18 19:35 ` Frederic Weisbecker
2009-03-18 18:58 ` Ingo Molnar
2009-03-18 19:04 ` Jaswinder Singh Rajput
2009-03-18 17:57 ` Jaswinder Singh Rajput
2009-03-18 18:57 ` [tip:tracing/ftrace] tracepoints: dont update zero-sized tracepoint sections Ingo Molnar
2009-03-19 7:18 ` oops in tracepoint_update_probe_range() Lai Jiangshan
2009-03-19 7:46 ` Ingo Molnar
2009-03-19 9:41 ` Jaswinder Singh Rajput
2009-03-19 13:22 ` Mathieu Desnoyers
2009-03-19 13:34 ` Steven Rostedt
2009-03-19 14:03 ` Mathieu Desnoyers
2009-03-19 15:50 ` Ingo Molnar
2009-03-19 16:00 ` Mathieu Desnoyers
2009-03-19 16:20 ` Steven Rostedt
2009-03-23 5:18 ` Rusty Russell
2009-03-19 15:42 ` Jaswinder Singh Rajput
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090318173347.GD5981@nowhere \
--to=fweisbec@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=jaswinder@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.