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]
Message-ID: <20181127144544.GG15747@kernel.org>
Date:   Tue, 27 Nov 2018 11:45:44 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Adrian Hunter <adrian.hunter@...el.com>
Cc:     Jiri Olsa <jolsa@...hat.com>, Andi Kleen <ak@...ux.intel.com>,
        linux-kernel@...r.kernel.org, leo.yan@...aro.org,
        David Miller <davem@...emloft.net>,
        Mathieu Poirier <mathieu.poirier@...aro.org>
Subject: Re: [PATCH V2 1/3] perf tools: Add fallback functions for cases
 where cpumode is insufficient

Em Tue, Nov 27, 2018 at 11:10:36AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Nov 06, 2018 at 11:07:10PM +0200, Adrian Hunter escreveu:
> > For branch stacks or branch samples, the sample cpumode might not be
> > correct because it applies only to the sample 'ip' and not necessary to
> > 'addr' or branch stack addresses. Add fallback functions that can be used
> > to deal with those cases
> 
> I've split this into two, and the first is causing this:
> 
> root@...co ~]# perf top
> perf: Segmentation fault
> -------- backtrace --------
> perf[0x59baca]
> /lib64/libc.so.6(+0x385bf)[0x7fa2775dc5bf]
> perf(perf_env__arch+0x34)[0x4b4514]
> perf(perf_env__single_address_space+0x1b)[0x57944b]
> perf(perf_session__new+0x17c)[0x4fdb3c]
> perf(cmd_top+0x162c)[0x45109c]
> perf[0x4a621e]
> perf(main+0x61c)[0x42cbfc]
> /lib64/libc.so.6(__libc_start_main+0xf2)[0x7fa2775c8412]
> perf(_start+0x2d)[0x42ce2d]
> [root@...co ~]#
> 
> Its the case where the env info comes from the running machine, via
> uname(), I'm working on a fix.

So I'll graft this just before your patch.

- Arnaldo

diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 59f38c7693f8..4c23779e271a 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -166,7 +166,7 @@ const char *perf_env__arch(struct perf_env *env)
 	struct utsname uts;
 	char *arch_name;
 
-	if (!env) { /* Assume local operation */
+	if (!env || !env->arch) { /* Assume local operation */
 		if (uname(&uts) < 0)
 			return NULL;
 		arch_name = uts.machine;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ