projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7a702f
)
perf tools: Avoid deadlock when map_groups are broken
author
Adrian Hunter
<
[email protected]
>
Wed, 19 Aug 2015 14:29:19 +0000
(17:29 +0300)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Wed, 19 Aug 2015 17:15:09 +0000
(14:15 -0300)
Attempting to clone map groups onto themselves will deadlock.
It only happens because of other bugs, but the code should protect
itself anyway.
Reported-by: Linus Torvalds <
[email protected]
>
Signed-off-by: Adrian Hunter <
[email protected]
>
Tested-by: Jiri Olsa <
[email protected]
>
Link:
http://lkml.kernel.org/r/
[email protected]
[ Use pr_debug() instead of dump_fprintf() ]
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/thread.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/thread.c
b/tools/perf/util/thread.c
index 28c4b746baa19bef9830814c4fe7c69f1be0b06b..0a9ae8014729c085ffd2872e2bc13871f79c9908 100644
(file)
--- a/
tools/perf/util/thread.c
+++ b/
tools/perf/util/thread.c
@@
-191,6
+191,12
@@
static int thread__clone_map_groups(struct thread *thread,
if (thread->pid_ == parent->pid_)
return 0;
+ if (thread->mg == parent->mg) {
+ pr_debug("broken map groups on thread %d/%d parent %d/%d\n",
+ thread->pid_, thread->tid, parent->pid_, parent->tid);
+ return 0;
+ }
+
/* But this one is new process, copy maps. */
for (i = 0; i < MAP__NR_TYPES; ++i)
if (map_groups__clone(thread->mg, parent->mg, i) < 0)