public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: David Miller <davem@davemloft.net>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: a.p.zijlstra@chello.nl, paulus@samba.org,
	linux-kernel@vger.kernel.org,
	=?unknown-8bit?B?RnLDqWTDqXJpYw==?= Weisbecker
	<fweisbec@gmail.com>
Subject: Re: perf per-symbol histogram causes memory corruption
Date: Thu, 25 Feb 2010 12:11:48 +0100	[thread overview]
Message-ID: <20100225111148.GA5754@elte.hu> (raw)
In-Reply-To: <20100225.022618.256301798.davem@davemloft.net>


(Added Arnaldo to the Cc: - he's maintaining the symbol lookup bits of perf.)

* David Miller <davem@davemloft.net> wrote:

> When builtin-annotate.c processes sample events via
> process_sample_event() it uses 'sample_filter'
> 
> sample_filter() sizes the histogram object for a symbol based upon the
> size, calculated as "sym->end - sym->start", to determine the number
> of IP sample slots to allocate.
> 
> The problem is, the sym->end value is not stable at this point.
> 
> For example, dso__load_sym() first loads all of the symbols, then it
> makes another pass over the symbols by calling symbols__fixup_end()
> which will adjust the sym->end values of various symbols.
> 
> At this point, the histogram IP sample array allocated by
> sample_filter() can become too small, and hits recorded can thus
> access past the end of the array corrupting memory.
> 
> I get this very reliably on sparc64, and it took me a few days to root
> cause this. :-)
> 
> I don't see an immediate way to fix this, any ideas?

  reply	other threads:[~2010-02-25 11:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-25 10:26 perf per-symbol histogram causes memory corruption David Miller
2010-02-25 11:11 ` Ingo Molnar [this message]
2010-02-25 14:13   ` Arnaldo Carvalho de Melo
2010-02-25 15:02     ` David Miller
2010-02-25 15:57       ` Arnaldo Carvalho de Melo
2010-02-25 16:25         ` David Miller

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=20100225111148.GA5754@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=davem@davemloft.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox