lkml.org 
[lkml]   [2019]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [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@kernel.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

    \
     
     \ /
      Last update: 2019-09-24 21:21    [W:3.431 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site