Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp796680imm; Wed, 26 Sep 2018 07:00:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV62NS/cJvGbTsjFcABfFJYeiVeIlZauQiOwvjmequFYYEA4OkbvxAfo23k2fpJktfZNrT7uH X-Received: by 2002:a62:8f0c:: with SMTP id n12-v6mr2873779pfd.172.1537970425629; Wed, 26 Sep 2018 07:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537970425; cv=none; d=google.com; s=arc-20160816; b=IkA69z7v+15sQYBlH/m7fe8BDFsW1MCCwx0667A1anq+H1sUQe+k/Vb5lunD9qmUpo mzcY8ok63YqRbbSOTKSH6MsrQNgRM0pq6knXHFwPHInUeFNE5CSkMyk9xRcg9sjKXqLF x6BPDCUjlkNdvrrqpwV0D1L0apsDQzia45sJXWYrAVu4wULYy1MsQStD0IMODNkjf+uq GGmrLJbelFd4UHy4wk6g1jClYLZr68cv3HAPv3GlDzNXlt5avaPNOIBH/U4cd6RZYDJH /ASmF2o4jYK75PsYsQKIvgs9qJotfnS09nIevYuTiz1eqPQHaNiWK1gp2qTsDiHgdWGs Th+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=i1Qtlkpx+6Z8imN6l1q1mTZGSu/ZqG0b/MQLOJ4rM04=; b=WDeVUGy6O/Wt+FEThf5uN73yRtlHX4QaG8mKtq2hoTeNAh12PhLCuajLMW7bkpthyk 42b77HbsxVkFDKYqc78MtzsjAGfiZcliN4HJKyEEPyO1YA/Nqr4NADfYElu1RG1VGw3S FvNZ2JOMH6noiXbqPeY/hzUkHiByjssb9hRvu4ajZZGK+UTEVKLYJnXv21amHy2I/Xdg irmJXCly86qH63q1uRYUsjv6IvyqjU7t6/Gt5SGjP2aiAyfumhBVaLFjKLhcx7oLefkW UBhHhzwHQwf9h4VKhqWHPt5FXwiBDXFdLRyzbIXPBbjjmtUWmSrjcHiLHFTiuJNoPklE ReNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kdab.com header.s=dkim header.b=nzEdnxYj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kdab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23-v6si5249270pgi.409.2018.09.26.07.00.10; Wed, 26 Sep 2018 07:00:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kdab.com header.s=dkim header.b=nzEdnxYj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kdab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727366AbeIZULa (ORCPT + 99 others); Wed, 26 Sep 2018 16:11:30 -0400 Received: from mail.kdab.com ([176.9.126.58]:32799 "EHLO mail.kdab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbeIZULa (ORCPT ); Wed, 26 Sep 2018 16:11:30 -0400 X-Greylist: delayed 361 seconds by postgrey-1.27 at vger.kernel.org; Wed, 26 Sep 2018 16:11:28 EDT Authentication-Results: mail.kdab.com (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=kdab.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kdab.com; h= content-transfer-encoding:mime-version:message-id:date:date :subject:subject:from:from; s=dkim; t=1537969941; x=1538833942; bh=i1Qtlkpx+6Z8imN6l1q1mTZGSu/ZqG0b/MQLOJ4rM04=; b=nzEdnxYjmPvW FPi1r69URrjkopwUBmABC1tL6gm+5R8VccgWWfp5dgaI5jTWG5R+UXM7lTDQZMid cnTKLL1ysrZH0kkhBXfDQUqToODfRn+g6O2dNmQH6IxgS7SbrhkfFEWkS5IfTso+ gskzoVwXoz0C4sbH0JtjiGmR1w1gTqA= X-Virus-Scanned: amavisd-new at kdab.com From: Milian Wolff To: acme@kernel.org, jolsa@kernel.org, yao.jin@linux.intel.com, namhyung@kernel.org Cc: Linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Milian Wolff , Sandipan Das Subject: [PATCH 1/3] perf report: don't try to map ip to invalid map Date: Wed, 26 Sep 2018 15:52:05 +0200 Message-Id: <20180926135207.30263-1-milian.wolff@kdab.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes a crash when the report encounters an address that could not be associated with an mmaped region: #0 0x00005555557bdc4a in callchain_srcline (ip=3D, sym=3D0x0, map=3D0x0) at util/ma= chine.c:2329 #1 unwind_entry (entry=3Dentry@entry=3D0x7fffffff9180, arg=3Darg@entry=3D= 0x7ffff5642498) at util/machine.c:2329 #2 0x00005555558370af in entry (arg=3D0x7ffff5642498, cb=3D0x5555557bdb5= 0 , thread=3D, ip=3D18446744073709551615) at= util/unwind-libunwind-local.c:586 #3 get_entries (ui=3Dui@entry=3D0x7fffffff9620, cb=3D0x5555557bdb50 , arg=3D0x7ffff5642498, max_stack=3D) at util/un= wind-libunwind-local.c:703 #4 0x0000555555837192 in _unwind__get_entries (cb=3D, arg= =3D, thread=3D, data=3D, max= _stack=3D) at util/unwind-libunwind-local.c:725 #5 0x00005555557c310f in thread__resolve_callchain_unwind (max_stack=3D1= 27, sample=3D0x7fffffff9830, evsel=3D0x555555c7b3b0, cursor=3D0x7ffff5642= 498, thread=3D0x555555c7f6f0) at util/machine.c:2351 #6 thread__resolve_callchain (thread=3D0x555555c7f6f0, cursor=3D0x7ffff5= 642498, evsel=3D0x555555c7b3b0, sample=3D0x7fffffff9830, parent=3D0x7ffff= fff97b8, root_al=3D0x7fffffff9750, max_stack=3D127) at util/machine.c:237= 8 #7 0x00005555557ba4ee in sample__resolve_callchain (sample=3D, cursor=3D, parent=3Dparent@entry=3D0x7fffffff97b8, e= vsel=3D, al=3Dal@entry=3D0x7fffffff9750, max_stack=3D) at util/callchain.c:1085 Signed-off-by: Milian Wolff Cc: Sandipan Das Cc: Arnaldo Carvalho de Melo --- tools/perf/util/machine.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index c4acd2001db0..0cb4f8bf3ca7 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2312,7 +2312,7 @@ static int unwind_entry(struct unwind_entry *entry,= void *arg) { struct callchain_cursor *cursor =3D arg; const char *srcline =3D NULL; - u64 addr; + u64 addr =3D entry->ip; =20 if (symbol_conf.hide_unresolved && entry->sym =3D=3D NULL) return 0; @@ -2324,7 +2324,8 @@ static int unwind_entry(struct unwind_entry *entry,= void *arg) * Convert entry->ip from a virtual address to an offset in * its corresponding binary. */ - addr =3D map__map_ip(entry->map, entry->ip); + if (entry->map) + addr =3D map__map_ip(entry->map, entry->ip); =20 srcline =3D callchain_srcline(entry->map, entry->sym, addr); return callchain_cursor_append(cursor, entry->ip, --=20 2.19.0