LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
To: Sandipan Das <sandipan@linux.ibm.com>, acme@kernel.org
Cc: jolsa@redhat.com, linux-kernel@vger.kernel.org,
	naveen.n.rao@linux.vnet.ibm.com, sukadev@linux.vnet.ibm.com,
	Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Subject: Re: [PATCH] perf report powerpc: Fix crash if callchain is empty
Date: Tue, 12 Jun 2018 09:28:09 +0530	[thread overview]
Message-ID: <7fe2c26e-a5a7-3141-870e-c93558bb082b@linux.ibm.com> (raw)
In-Reply-To: <20180611104049.11048-1-sandipan@linux.ibm.com>



On 06/11/2018 04:10 PM, Sandipan Das wrote:
> For some cases, the callchain provided by the kernel may be
> empty. So, the callchain ip filtering code will cause a crash
> if we do not check whether the struct ip_callchain pointer is
> NULL before accessing any members.
> 
> This can be observed on a powerpc64le system running Fedora 27
> as shown below.
> 
>   # perf record -b -e cycles:u ls
> 
> Before applying this patch:
> 
>   # perf report --branch-history
> 
>   perf: Segmentation fault
>   -------- backtrace --------
>   perf[0x1027615c]
>   linux-vdso64.so.1(__kernel_sigtramp_rt64+0x0)[0x7fff856304d8]
>   perf(arch_skip_callchain_idx+0x44)[0x10257c58]
>   perf[0x1017f2e4]
>   perf(thread__resolve_callchain+0x124)[0x1017ff5c]
>   perf(sample__resolve_callchain+0xf0)[0x10172788]
>   ...
> 
> After applying this patch:
> 
>   # perf report --branch-history
> 
>   Samples: 25  of event 'cycles:u', Event count (approx.): 2306870
>     Overhead  Source:Line            Symbol                   Shared Object
>   +   11.60%  _init+35736            [.] _init                ls
>   +    9.84%  strcoll_l.c:137        [.] __strcoll_l          libc-2.26.so
>   +    9.16%  memcpy.S:175           [.] __memcpy_power7      libc-2.26.so
>   +    9.01%  gconv_charset.h:54     [.] _nl_find_locale      libc-2.26.so
>   +    8.87%  dl-addr.c:52           [.] _dl_addr             libc-2.26.so
>   +    8.83%  _init+236              [.] _init                ls
>   ...
> 
> Reported-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>


Acked-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>


  reply	other threads:[~2018-06-12  3:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 10:40 Sandipan Das
2018-06-12  3:58 ` Ravi Bangoria [this message]
2018-06-13 19:58   ` Arnaldo Carvalho de Melo
2018-06-26  6:52 ` [tip:perf/urgent] " tip-bot for Sandipan Das

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=7fe2c26e-a5a7-3141-870e-c93558bb082b@linux.ibm.com \
    --to=ravi.bangoria@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=sandipan@linux.ibm.com \
    --cc=sukadev@linux.vnet.ibm.com \
    --subject='Re: [PATCH] perf report powerpc: Fix crash if callchain is empty' \
    /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

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).