From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965027AbbJ2JnP (ORCPT ); Thu, 29 Oct 2015 05:43:15 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56186 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbbJ2JnN (ORCPT ); Thu, 29 Oct 2015 05:43:13 -0400 Date: Thu, 29 Oct 2015 02:42:58 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: hpa@zytor.com, jolsa@redhat.com, adrian.hunter@intel.com, ak@linux.intel.com, tglx@linutronix.de, mpetlan@redhat.com, jolsa@kernel.org, mingo@kernel.org, acme@redhat.com, namhyung@kernel.org, a.p.zijlstra@chello.nl, kan.liang@intel.com, linux-kernel@vger.kernel.org Reply-To: hpa@zytor.com, adrian.hunter@intel.com, jolsa@redhat.com, tglx@linutronix.de, ak@linux.intel.com, mpetlan@redhat.com, mingo@kernel.org, jolsa@kernel.org, a.p.zijlstra@chello.nl, kan.liang@intel.com, namhyung@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org In-Reply-To: <20151026135130.GA26003@krava.brq.redhat.com> References: <20151026135130.GA26003@krava.brq.redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf symbols: Fix endless loop in dso__split_kallsyms_for_kcore Git-Commit-ID: 443f8c75e8d58d394b0e65b47e02e5cd8ed32b41 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 443f8c75e8d58d394b0e65b47e02e5cd8ed32b41 Gitweb: http://git.kernel.org/tip/443f8c75e8d58d394b0e65b47e02e5cd8ed32b41 Author: Jiri Olsa AuthorDate: Mon, 26 Oct 2015 14:51:30 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 28 Oct 2015 11:19:30 -0300 perf symbols: Fix endless loop in dso__split_kallsyms_for_kcore Currently we split symbols based on the map comparison, but symbols are stored within dso objects and maps could point into same dso objects (kernel maps). Hence we could end up changing rbtree we are currently iterating and mess it up. It's easily reproduced on s390x by running: $ perf record -a -- sleep 3 $ perf buildid-list -i perf.data --with-hits The fix is to compare dso objects instead. Reported-by: Michael Petlan Signed-off-by: Jiri Olsa Acked-by: Adrian Hunter Cc: Andi Kleen Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20151026135130.GA26003@krava.brq.redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/symbol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 71bf711..b4cc766 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -680,7 +680,7 @@ static int dso__split_kallsyms_for_kcore(struct dso *dso, struct map *map, pos->start -= curr_map->start - curr_map->pgoff; if (pos->end) pos->end -= curr_map->start - curr_map->pgoff; - if (curr_map != map) { + if (curr_map->dso != map->dso) { rb_erase_init(&pos->rb_node, root); symbols__insert( &curr_map->dso->symbols[curr_map->type],