From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934144AbdJRMID (ORCPT ); Wed, 18 Oct 2017 08:08:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:49398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932333AbdJRMIC (ORCPT ); Wed, 18 Oct 2017 08:08:02 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F23D21879 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Wed, 18 Oct 2017 09:07:59 -0300 From: Arnaldo Carvalho de Melo To: Ravi Bangoria Cc: ak@linux.intel.com, alexander.shishkin@linux.intel.com, peterz@infradead.org, mingo@redhat.com, jolsa@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf record: Fix tool crash with xyarray Message-ID: <20171018120759.GD3707@kernel.org> References: <1508327446-15302-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1508327446-15302-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Oct 18, 2017 at 05:20:46PM +0530, Ravi Bangoria escreveu: > I see 'perf record -p ' crashes with following log: I just applied the same patch, coming from Jin Yao, thanks! I'll add a reported-by you there, - Arnaldo > *** Error in `./perf': free(): invalid next size (normal): 0x000000000298b340 *** > ======= Backtrace: ========= > /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f7fd85c87e5] > /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f7fd85d137a] > /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f7fd85d553c] > ./perf(perf_evsel__close+0xb4)[0x4b7614] > ./perf(perf_evlist__delete+0x100)[0x4ab180] > ./perf(cmd_record+0x1d9)[0x43a5a9] > ./perf[0x49aa2f] > ./perf(main+0x631)[0x427841] > /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f7fd8571830] > ./perf(_start+0x29)[0x427a59] > > This is because functions xyarray__max_x() and xyarray__max_y() > are returning incorrect values, causing crash while accessing > xyarray. > > Fixes: d74be4767367 ("perf xyarray: Save max_x, max_y") > Signed-off-by: Ravi Bangoria > --- > tools/perf/util/xyarray.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/util/xyarray.h b/tools/perf/util/xyarray.h > index 4ba726c..d6858ed 100644 > --- a/tools/perf/util/xyarray.h > +++ b/tools/perf/util/xyarray.h > @@ -21,12 +21,12 @@ static inline void *xyarray__entry(struct xyarray *xy, int x, int y) > return &xy->contents[x * xy->row_size + y * xy->entry_size]; > } > > -static inline int xyarray__max_y(struct xyarray *xy) > +static inline int xyarray__max_x(struct xyarray *xy) > { > return xy->max_x; > } > > -static inline int xyarray__max_x(struct xyarray *xy) > +static inline int xyarray__max_y(struct xyarray *xy) > { > return xy->max_y; > } > -- > 2.7.4