From: Arnaldo Carvalho de Melo on
From: Konstantin Stepanyuk <kostyas(a)>

hist_entry__annotate() runs objdump with -S option so the output may contain
lines of any format. If a line starts with a colon strtoull() returns 0 and
calculated offset will be negative. This causes perf annotate segfaults.

Make sure that strtoull() has parsed at least one digit.

Cc: David S. Miller <davem(a)>
Cc: Frédéric Weisbecker <fweisbec(a)>
Cc: Ingo Molnar <mingo(a)>
Cc: Mike Galbraith <efault(a)>
Cc: Paul Mackerras <paulus(a)>
Cc: Peter Zijlstra <peterz(a)>
Cc: Stephane Eranian <eranian(a)>
Cc: Tom Zanussi <tzanussi(a)>
LKML-Reference: <new-submission>
Signed-off-by: Konstantin Stepanyuk <konstantin.stepanyuk(a)>
Signed-off-by: Arnaldo Carvalho de Melo <acme(a)>
tools/perf/util/hist.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index cbf7eae..07f89b6 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -965,7 +965,7 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
* Parse hexa addresses followed by ':'
line_ip = strtoull(tmp, &tmp2, 16);
- if (*tmp2 != ':')
+ if (*tmp2 != ':' || tmp == tmp2)
line_ip = -1;


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at