From: Peter Zijlstra <peterz@infradead.org>
To: prasad@linux.vnet.ibm.com
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
"mingo@elte.hu" <mingo@elte.hu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Bug][perf hw-breakpoints] Null pointer exception when using register_user_hw_breakpoint with inherit flag
Date: Thu, 17 Dec 2009 18:13:09 +0100 [thread overview]
Message-ID: <1261069989.27920.604.camel@laptop> (raw)
In-Reply-To: <20091217170309.GA5457@in.ibm.com>
On Thu, 2009-12-17 at 22:33 +0530, K.Prasad wrote:
> Hi,
> While testing out two new interfaces (to be sent separately) that
> in-turn uses register_user_hw_breakpoint() and unregister_hw_breakpoint(),
> I noticed the following error.
>
> The bug is seen only when 'inherit' flag of 'perf_event_attr' is set
> (not otherwise) before the call to register_user_hw_breakpoint(),
> and when the user-space process tries to spawn a new thread.
>
> Please find the screen logs taken from an x86 box, running -tip kernel
> commit 7818b3d0fc68f5c2a85fed86d9fa37131c5a3068.
>
> Digging further, the causative line of code appears to be
>
> atomic_long_inc(&parent_event->filp->f_count);
>
> in inherit_event() function, wherein f_count is NULL (and hence the
> error). I haven't analysed further to understand why/if the said
> pointer is/should be NULL.
>
> Thought might bring it to the community's notice for wider
> notice/further investigation.
Ooh, cute, it seems the inherit code assumes we have a file structure
around, which isn't true for events that get created through the kernel
interface.
I think its a simple matter of testing to see if event->filp is set, but
we'd better audit the code for it.
prev parent reply other threads:[~2009-12-17 17:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 17:03 K.Prasad
2009-12-17 17:13 ` Peter Zijlstra [this message]
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=1261069989.27920.604.camel@laptop \
--to=peterz@infradead.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=prasad@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®