lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 1 Jul 2016 09:02:47 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	David Ahern <dsahern@...il.com>
Cc:	Namhyung Kim <namhyung@...nel.org>,
	Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [BUG] perf test 29 crashing

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;

Powered by blists - more mailing lists