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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 4 Jan 2011 12:12:14 -0200
From:	Arnaldo Carvalho de Melo <acme@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	linux-kernel@...r.kernel.org,
	Frederic Weisbecker <fweisbec@...il.com>,
	Han Pingtian <phan@...hat.com>, Mike Galbraith <efault@....de>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Tom Zanussi <tzanussi@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>, mingo@...e.hu
Subject: Re: [GIT PULL||RFC 00/11] perf library and regression testing
 improvements

Em Tue, Jan 04, 2011 at 02:59:00PM +0100, Stephane Eranian escreveu:
> Arnaldo,
> 
> The version of perf at tip-x86 commit 9274b36, segfaults for me:
> 
> $ gdb perf
> (gdb) r stat date
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x7fdc602eb6e0 (LWP 4590)]
> cmd_stat (argc=1, argv=0x7fff6fa2a9f0, prefix=<value optimized out>)
> at builtin-stat.c:206
> 206			update_stats(&ps->res_stats[i], count[i]);
> (gdb) bt
> #0  cmd_stat (argc=1, argv=0x7fff6fa2a9f0, prefix=<value optimized
> out>) at builtin-stat.c:206
> #1  0x0000000000405c8b in handle_internal_command (argc=2,
> argv=0x7fff6fa2a9f0) at perf.c:286
> #2  0x00000000004060b0 in main (argc=2, argv=0x7fff6fa2a680) at perf.c:403
> 
> Most like ps is NULL.

Well, it shoudldn't, as we do, before calling that function:

        list_for_each_entry(pos, &evsel_list, node) {
                if (perf_evsel__alloc_stat_priv(pos) < 0 ||
                    perf_evsel__alloc_counts(pos, cpus->nr) < 0 ||
                    perf_evsel__alloc_fd(pos, cpus->nr, threads->nr) < 0)
                        goto out_free_fd;
        }

And then at line 206 it does:

	update_stats(&ps->res_stats[i], count[i]);

ps was set to be:

	struct perf_stat *ps = counter->priv;

that was set by perf_evsel__alloc_stat_priv

and count is

u64 *count = counter->counts->aggr.values;

That was allocated by perf_evsel__alloc_counts

/me scratches head :-\

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ