[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E9F4392.406@gmail.com>
Date: Wed, 19 Oct 2011 15:39:30 -0600
From: David Ahern <dsahern@...il.com>
To: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
CC: linux-kernel@...r.kernel.org, mingo@...e.hu, peterz@...radead.org,
fweisbec@...il.com
Subject: Re: [PATCH] perf top: fix crash on annotate request
On 10/19/2011 01:20 PM, Arnaldo Carvalho de Melo wrote:
> Can you check if that is the problem? I.e. take notes->lock, check if
> ->src is NULL, if so call symbol__alloc_hist, etc?
>
Reproduced it on a lab box. This fixes the segfault:
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index bc8f477..6bd501a 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -253,6 +253,17 @@ static int symbol__parse_objdump_line(struct symbol
*sym, struct map *map,
free(line);
return -1;
}
+
+ pthread_mutex_lock(¬es->lock);
+ if (notes->src == NULL &&
+ symbol__alloc_hist(sym, 1) < 0) {
+ pthread_mutex_unlock(¬es->lock);
+ ui__warning("Not enough memory for annotating '%s' symbol!\n",
+ sym->name);
+ return -1;
+ }
+ pthread_mutex_unlock(¬es->lock);
+
objdump__add_line(¬es->src->source, objdump_line);
return 0;
Should I plumb nr_events down versus assuming its 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