• Konstantin Stepanyuk's avatar
    perf hist: fix objdump output parsing · 75d9ef17
    Konstantin Stepanyuk authored
    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@davemloft.net>
    Cc: Frédéric Weisbecker <fweisbec@gmail.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Tom Zanussi <tzanussi@gmail.com>
    LKML-Reference: <new-submission>
    Signed-off-by: default avatarKonstantin Stepanyuk <konstantin.stepanyuk@gmail.com>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    75d9ef17
hist.c 24.7 KB