Skip to content

Commit 9481ede

Browse files
committed
perf annotate browser: Handle NULL jump targets
In annotate_browser__mark_jump_targets 702 dlt = browser->offsets[dl->ops.target]; 703 bdlt = disasm_line__browser(dlt); 704 bdlt->jump_target = true; 705 } 706 707 } (gdb) p size $5 = 2415 (gdb) p offset $6 = 140 (gdb) p dl->ops.target $7 = 143 (gdb) p browser->offsets[143] $8 = (struct disasm_line *) 0x0 (gdb) p dl->name $9 = 0x2363bd0 "je" (gdb) Really strange, the code assumed that at the jump target we would have an assembly line, but only in the previous instruction offset we have a 'lock': (gdb) p browser->offsets[144] $10 = (struct disasm_line *) 0x0 (gdb) p browser->offsets[142] $11 = (struct disasm_line *) 0x27bd620 (gdb) p browser->offsets[142]->name $12 = 0x237a8a0 "lock" (gdb) I'll study this more, but for now I'll just check if there is a disasm_line at dl->ops.target, i.e. a valid jump target. Reported-by: Hagen Paul Pfeifer <[email protected]> Reported-by: Ingo Molnar <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent a3f895b commit 9481ede

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/perf/ui/browsers/annotate.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,13 @@ static void annotate_browser__mark_jump_targets(struct annotate_browser *browser
700700
}
701701

702702
dlt = browser->offsets[dl->ops.target];
703+
/*
704+
* FIXME: Oops, no jump target? Buggy disassembler? Or do we
705+
* have to adjust to the previous offset?
706+
*/
707+
if (dlt == NULL)
708+
continue;
709+
703710
bdlt = disasm_line__browser(dlt);
704711
bdlt->jump_target = true;
705712
}

0 commit comments

Comments
 (0)