linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arun Sharma <asharma@fb.com>
To: David Ahern <dsahern@gmail.com>
Cc: Sam Liao <phyomh@gmail.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] [perf] Add inverted call graph report support.
Date: Thu, 09 Jun 2011 13:13:40 -0700	[thread overview]
Message-ID: <4DF12974.7030707@fb.com> (raw)
In-Reply-To: <4DF128B1.4010409@gmail.com>

On 6/9/11 1:10 PM, David Ahern wrote:
>
>
> On 06/09/2011 01:33 PM, Arun Sharma wrote:
>> On Thu, Jun 09, 2011 at 02:44:19PM +0800, Sam Liao wrote:
>>> --- a/tools/perf/util/session.c
>>> +++ b/tools/perf/util/session.c
>>> @@ -247,9 +247,14 @@ int perf_session__resolve_callchain(struct
>>> perf_session *self,
>>>   	callchain_cursor_reset(&self->callchain_cursor);
>>>
>>>   	for (i = 0; i<  chain->nr; i++) {
>>> -		u64 ip = chain->ips[i];
>>> +		u64 ip;
>>>   		struct addr_location al;
>>>
>>> +		if (callchain_param.order == ORDER_CALLEE)
>>> +			ip = chain->ips[i];
>>> +		else
>>> +			ip = chain->ips[chain->nr - i - 1];
>>
>> This can dereference a bad pointer if chain->nr == 0.
>
> Should not enter the loop if chain->nr is 0 (See for arg).

Ah right. I had this problem with an earlier version of the patch. This 
version seems to be fine.

  -Arun

  reply	other threads:[~2011-06-09 20:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09  6:44 [PATCH] [perf] Add inverted call graph report support Sam Liao
2011-06-09 19:33 ` Arun Sharma
2011-06-09 20:10   ` David Ahern
2011-06-09 20:13     ` Arun Sharma [this message]
2011-06-14 22:15   ` Arun Sharma
2011-06-15  6:01     ` Sam Liao
2011-06-15  8:15       ` Ingo Molnar
2011-06-15 22:24         ` Frederic Weisbecker
2011-06-10 20:42 ` Arnaldo Carvalho de Melo
2011-06-15 19:40   ` Frederic Weisbecker
2011-06-15 22:15 ` Frederic Weisbecker

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=4DF12974.7030707@fb.com \
    --to=asharma@fb.com \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=phyomh@gmail.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;
as well as URLs for NNTP newsgroup(s).