Re: [PATCH v2] perf mem2node: avoid double free related to realloc

From: Arnaldo Carvalho de Melo
Date: Thu Apr 30 2020 - 09:23:06 EST


Em Thu, Apr 30, 2020 at 10:15:41AM +0200, Jiri Olsa escreveu:
> On Fri, Mar 20, 2020 at 11:23:47AM -0700, Ian Rogers wrote:
> > Realloc of size zero is a free not an error, avoid this causing a double
> > free. Caught by clang's address sanitizer:

> > ==2634==ERROR: AddressSanitizer: attempting double-free on 0x6020000015f0 in thread T0:
> > #0 0x5649659297fd in free llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:123:3

> > v2: add a WARN_ON_ONCE when the free condition arises.

> > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

> I overlooked v2 for this, sry

> Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

Thanks, applied,

- Arnaldo