mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: acme@kernel.org
Cc: jolsa@redhat.com, linux-kernel@vger.kernel.org,
	namhyung@kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 1/2] perf, tools: Fix crash while reading old perf.data
Date: Fri, 21 Nov 2014 13:37:59 -0800	[thread overview]
Message-ID: <1416605880-25055-1-git-send-email-andi@firstfloor.org> (raw)

From: Andi Kleen <ak@linux.intel.com>

In some cases when reading perf.data generated by much
older perf I got segfaults with dso->long_name being zero.
This patch fixes them for me.

Haven't tracked down the exact cause. I assume it's
some error path that doesn't set it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 52e9490..6266041 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1106,7 +1106,7 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
 		if (__machine__create_kernel_maps(machine, kernel) < 0)
 			goto out_problem;
 
-		if (strstr(dso->long_name, "vmlinux"))
+		if (dso->long_name && strstr(dso->long_name, "vmlinux"))
 			dso__set_short_name(dso, "[kernel.vmlinux]", false);
 
 		machine__set_kernel_mmap_len(machine, event);
-- 
1.9.3


             reply	other threads:[~2014-11-21 21:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 21:37 Andi Kleen [this message]
2014-11-21 21:38 ` [PATCH 2/2] perf, tools: Allow to force redirect pr_debug to stderr Andi Kleen
2014-12-08  6:50   ` [tip:perf/core] perf " tip-bot for Andi Kleen
2014-11-25  9:53 ` [PATCH 1/2] perf, tools: Fix crash while reading old perf.data Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416605880-25055-1-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®