From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752266AbcGAHCv (ORCPT ); Fri, 1 Jul 2016 03:02:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37144 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752025AbcGAHCt (ORCPT ); Fri, 1 Jul 2016 03:02:49 -0400 Date: Fri, 1 Jul 2016 09:02:47 +0200 From: Jiri Olsa To: David Ahern Cc: Namhyung Kim , Arnaldo Carvalho de Melo , lkml Subject: Re: [BUG] perf test 29 crashing Message-ID: <20160701070247.GC28965@krava> References: <20160628123410.GA1862@krava> <20160628165914.GJ27027@kernel.org> <6939ccab-dc51-27ab-69c0-9600f3a7ed6f@gmail.com> <20160629022006.GC1628@sejong> <20160630151016.GA4828@krava> <20160630161816.GA2939@krava> <7450cf93-e2dd-ea6e-dfcd-fee2965acab8@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7450cf93-e2dd-ea6e-dfcd-fee2965acab8@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 01 Jul 2016 07:02:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 30, 2016 at 01:41:57PM -0600, David Ahern wrote: > On 6/30/16 10:18 AM, Jiri Olsa wrote: > > it was the setup in my .perfconfig: > > > > [call-graph] > > threshold=10 > > > > caused some of the callchains to disappear and screw the test, > > Did you find out why it caused a segfault? yep, the code of tests/hists_cumulate.c::do_test expects each hist_entry to carry callchain, and the option above cause only some of the had it: do_test { root = &he->callchain->node.rb_root; cnode = rb_entry(rb_first(root), struct callchain_node, rb_node); c = 0; list_for_each_entry(clist, &cnode->val, list) { ^ - root is empty, cnode is trash and this itaration segfaults maybe we could also add check below jirka --- diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c index 1208284a7338..9fd54b79a788 100644 --- a/tools/perf/tests/hists_cumulate.c +++ b/tools/perf/tests/hists_cumulate.c @@ -216,6 +216,8 @@ static int do_test(struct hists *hists, struct result *expected, size_t nr_expec /* check callchain entries */ root = &he->callchain->node.rb_root; + + TEST_ASSERT_VAL("callchains expected", !RB_EMPTY_ROOT(root)); cnode = rb_entry(rb_first(root), struct callchain_node, rb_node); c = 0;