Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752612AbdDIRGI (ORCPT ); Sun, 9 Apr 2017 13:06:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752230AbdDIRGA (ORCPT ); Sun, 9 Apr 2017 13:06:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1D674A2887 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1D674A2887 Date: Sun, 9 Apr 2017 19:05:52 +0200 From: Jiri Olsa To: "Du, Changbin" Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Peter Zijlstra , Ingo Molnar , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] perf: fix double free at function perf_hpp__reset_output_field Message-ID: <20170409170552.GA16624@krava> References: <20170315021631.31980-1-changbin.du@intel.com> <20170327062255.27309-1-changbin.du@intel.com> <20170404151940.GD12903@kernel.org> <20170404155103.GF12903@kernel.org> <20170405024422.GA4361@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170405024422.GA4361@intel.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 09 Apr 2017 17:05:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1452 Lines: 34 On Wed, Apr 05, 2017 at 10:44:22AM +0800, Du, Changbin wrote: > On Tue, Apr 04, 2017 at 12:51:03PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Wed, Apr 05, 2017 at 12:34:59AM +0900, Namhyung Kim escreveu: > > > Hi Arnaldo, > > > > > > On Wed, Apr 5, 2017 at 12:19 AM, Arnaldo Carvalho de Melo > > > wrote: > > > > Em Mon, Mar 27, 2017 at 02:22:55PM +0800, changbin.du@intel.com escreveu: > > > >> From: Changbin Du > > > >> > > > >> Some perf_hpp_fmt both registered at field and sort list. For such > > > >> instance, we only can free it when removed from the both lists. This > > > >> function currently only used by self-test code, but still should fix > > > >> it. > > > > > > > > Looks sane, applying, > > > > > > > > Jiri, Namhyung, please holler (or ack) if needed, > > > > > > Did you actually see the double free problem? AFAICS the old code > > > > I assumed that he had seen it, in some self-test code, Changbin, can you > > please show command output or further describe when this patch would be > > necessary? > > > Arnaldo, I did observe this issue but not in self-test code. The self-test code > uses that function but does not have a case that a fmt linked to two both list. > I found this issue when I try to add 'dynamic sort' feature to perf, which > I use this function to reset out fields. could you post it with the rest of your patches? might be easier to review thanks, jirka