linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Ian Rogers <irogers@google.com>,
	Riccardo Mancini <rickyman7@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Leo Yan <leo.yan@linaro.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf session: add missing evlist__delete when deleting a session
Date: Thu, 1 Jul 2021 15:04:59 -0300	[thread overview]
Message-ID: <YN4Dy9qLrop4pM+9@kernel.org> (raw)
In-Reply-To: <YNXD2xN2wrZgdbwO@krava>

Em Fri, Jun 25, 2021 at 01:54:03PM +0200, Jiri Olsa escreveu:
> On Thu, Jun 24, 2021 at 10:39:34PM -0700, Ian Rogers wrote:
> > On Thu, Jun 24, 2021 at 4:20 PM Riccardo Mancini <rickyman7@gmail.com> wrote:
> > >
> > > ASan reports a memory leak caused by evlist not being deleted on exit in
> > > perf-report, perf-script and perf-data.
> > > The problem is caused by evlist->session not being deleted, which is
> > > allocated in perf_session__read_header, called in perf_session__new if
> > > perf_data is in read mode.
> > > In case of write mode, the session->evlist is filled by the caller.
> > > This patch solves the problem by calling evlist__delete in
> > > perf_session__delete if perf_data is in read mode.
> 
> ugh, I'm surprised we did not free that.. and can't find
> in git log we ever did ;-) I briefly check commands using
> sessions and looks like it's correct
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>
> 
> > 
> > Acked-by: Ian Rogers <irogers@google.com>
> > 
> > It is messy that in read mode the session owns the evlist, but
> > otherwise not. Imo, it'd be nice to make the ownership unconditional.
> 
> yep, would be nice

Thanks, applied.

Riccardo, next time please consider adding a Fixes: tag so that the
stable@kernel.org guys can pick this for stable releases.

- Arnaldo


      parent reply	other threads:[~2021-07-01 18:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24 23:19 [PATCH v2] perf session: add missing evlist__delete when deleting a session Riccardo Mancini
2021-06-25  5:39 ` Ian Rogers
2021-06-25 11:54   ` Jiri Olsa
2021-06-25 15:45     ` Riccardo Mancini
2021-06-27 17:29       ` Jiri Olsa
2021-07-01 18:04     ` Arnaldo Carvalho de Melo [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=YN4Dy9qLrop4pM+9@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rickyman7@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).