Linux Perf Users
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 1/4] perf record: Fix a segfault in record__read_lost_samples()
Date: Sun, 25 Sep 2022 09:08:39 +0800	[thread overview]
Message-ID: <Yy+p41f19aiwi/cd@leoy-huanghe> (raw)
In-Reply-To: <20220923173142.805896-2-namhyung@kernel.org>

On Fri, Sep 23, 2022 at 10:31:39AM -0700, Namhyung Kim wrote:
> When it fails to open events record__open() returns without setting the
> session->evlist.  Then it gets a segfault in the function trying to read
> lost sample counts.  You can easily reproduce it as a normal user like:
> 
>   $ perf record -p 1 true
>   ...
>   perf: Segmentation fault
>   ...
> 
> Skip the function if it has no evlist.  And add more protection for evsels
> which are not properly initialized.
> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Tested-by: Leo Yan <leo.yan@linaro.org>

  parent reply	other threads:[~2022-09-25  1:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 17:31 [PATCH 0/4] perf tools: Assorted random fixes and updates Namhyung Kim
2022-09-23 17:31 ` [PATCH 1/4] perf record: Fix a segfault in record__read_lost_samples() Namhyung Kim
2022-09-23 23:20   ` Ian Rogers
2022-09-25  1:08   ` Leo Yan [this message]
2022-09-23 17:31 ` [PATCH 2/4] perf inject: Clarify build-id options a little bit Namhyung Kim
2022-09-23 17:31 ` [PATCH 3/4] perf tools: Add 'addr' sort key Namhyung Kim
2022-09-23 23:21   ` Ian Rogers
2022-09-23 17:31 ` [PATCH 4/4] perf annotate: Toggle full address <-> offset display Namhyung Kim
2022-09-23 23:22   ` Ian Rogers
2022-09-26 13:09 ` [PATCH 0/4] perf tools: Assorted random fixes and updates Arnaldo Carvalho de Melo

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=Yy+p41f19aiwi/cd@leoy-huanghe \
    --to=leo.yan@linaro.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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