[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-15f3fa4e7f608c5ce19187b3b4a953222fdfa751@git.kernel.org>
Date: Tue, 18 Aug 2009 12:06:36 GMT
From: tip-bot for Ingo Molnar <mingo@...e.hu>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, acme@...hat.com, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
torvalds@...ux-foundation.org, efault@....de, fweisbec@...il.com,
tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perfcounters/urgent] perf annotate: Fix segmentation fault
Commit-ID: 15f3fa4e7f608c5ce19187b3b4a953222fdfa751
Gitweb: http://git.kernel.org/tip/15f3fa4e7f608c5ce19187b3b4a953222fdfa751
Author: Ingo Molnar <mingo@...e.hu>
AuthorDate: Tue, 18 Aug 2009 13:52:28 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 18 Aug 2009 14:00:52 +0200
perf annotate: Fix segmentation fault
Linus reported this perf annotate segfault:
[torvalds@...alem git]$ perf annotate unmap_vmas
Segmentation fault
#0 map__clone (self=<value optimized out>) at builtin-annotate.c:236
#1 thread__fork (self=<value optimized out>) at builtin-annotate.c:372
The bug here was that builtin-annotate.c was a copy of
builtin-report.c and a threading related fix to builtin-report.c
didnt get propagated to builtin-annotate.c ...
Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
tools/perf/builtin-annotate.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 1dba568..343e7b1 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -980,6 +980,13 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head)
(void *)(long)(event->header.size),
event->fork.pid, event->fork.ppid);
+ /*
+ * A thread clone will have the same PID for both
+ * parent and child.
+ */
+ if (thread == parent)
+ return 0;
+
if (!thread || !parent || thread__fork(thread, parent)) {
dprintf("problem processing PERF_EVENT_FORK, skipping event.\n");
return -1;
--
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