Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757489Ab0GVHVB (ORCPT ); Thu, 22 Jul 2010 03:21:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24758 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537Ab0GVHU6 (ORCPT ); Thu, 22 Jul 2010 03:20:58 -0400 Date: Thu, 22 Jul 2010 10:20:44 +0300 From: Gleb Natapov To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, peterz@infradead.org, paulus@samba.org Subject: perf annotate segfaults when source code has goto label that looks like hex number Message-ID: <20100722072044.GD27177@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1089 Lines: 43 The script below demonstrate this. The problem is in hist_entry__parse_objdump_line(): if (*tmp) { /* * Parse hexa addresses followed by ':' */ line_ip = strtoull(tmp, &tmp2, 16); if (*tmp2 != ':' || tmp == tmp2) line_ip = -1; } strtoull() returns valid number when it gets line with label and following test passes too. I can't think of a way to unambiguously distinguish between label and valid rip. May be running objdump with --prefix-addresses will help, but it may make other thing unambiguous. === script === cat > test.c << EOF int main(int argc, char **argv) { int i; while(1) { i++; if (i == 10000000) goto add; } add: return 0; } EOF gcc -g test.c perf record ./a.out perf annotate -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/