[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190924192046.GA20773@kernel.org>
Date: Tue, 24 Sep 2019 16:20:46 -0300
From: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Andi Kleen <ak@...ux.intel.com>, Andi Kleen <andi@...stfloor.org>,
jolsa@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] perf, stat: Fix free memory access / memory leaks in
metrics
Em Tue, Sep 24, 2019 at 04:44:18PM +0200, Jiri Olsa escreveu:
> On Tue, Sep 24, 2019 at 07:08:56AM -0700, Andi Kleen wrote:
> > > > expr__ctx_init(&pctx);
> > > > + /* Must be first id entry */
> > > > + expr__add_id(&pctx, name, avg);
> > >
> > > hum, shouldn't u instead use strdup(name) instead of name?
> >
> > The cleanup loop later skips freeing the first entry.
>
> aaah, nice ;-)
>
> Acked-by: Jiri Olsa <jolsa@...nel.org>
Thanks, reproduced and applied, before the patch:
# perf stat -M IpB,IpCall,IpTB,IPC,Retiring_SMT,Frontend_Bound_SMT,Kernel_Utilization,CPU_Utilization --metric-only -a -I 1000 sleep 2
# time CPU_Utilization
1.000470810 free(): double free detected in tcache 2
Aborted (core dumped)
#
- Arnaldo
Powered by blists - more mailing lists