[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-70597f21f128b7dd6a2490078bea99d704b6f8c3@git.kernel.org>
Date: Tue, 3 Aug 2010 05:54:59 GMT
From: tip-bot for Arnaldo Carvalho de Melo <acme@...hat.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, eranian@...gle.com, acme@...hat.com,
hpa@...or.com, mingo@...hat.com, peterz@...radead.org,
efault@....de, fweisbec@...il.com, tglx@...utronix.de
Subject: [tip:perf/core] perf session: Invalidate last_match when removing threads from rb_tree
Commit-ID: 70597f21f128b7dd6a2490078bea99d704b6f8c3
Gitweb: http://git.kernel.org/tip/70597f21f128b7dd6a2490078bea99d704b6f8c3
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Mon, 2 Aug 2010 18:59:28 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 2 Aug 2010 19:01:09 -0300
perf session: Invalidate last_match when removing threads from rb_tree
If we receive two PERF_RECORD_EXIT for the same thread, we can end up
reusing session->last_match and trying to remove the thread twice from
the rb_tree, causing a segfault, so invalidade last_match in
perf_session__remove_thread.
Receiving two PERF_RECORD_EXIT for the same thread is a bug, but its a
harmless one if we make the tool more robust, like this patch does.
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Mike Galbraith <efault@....de>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/session.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 5d2fd52..fa9d652 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -166,6 +166,7 @@ void perf_session__delete(struct perf_session *self)
void perf_session__remove_thread(struct perf_session *self, struct thread *th)
{
+ self->last_match = NULL;
rb_erase(&th->rb_node, &self->threads);
/*
* We may have references to this thread, for instance in some hist_entry
--
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