Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4379287imm; Mon, 15 Oct 2018 13:52:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV60DOI2zQR0LP1Vh+FJ6y10xh6mN3BHW1ZE4z65z4T9n213iqhHIMc3XoPnvPEg94nJvKxet X-Received: by 2002:a63:f711:: with SMTP id x17-v6mr17387455pgh.322.1539636747203; Mon, 15 Oct 2018 13:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636747; cv=none; d=google.com; s=arc-20160816; b=B0pmpkqdJUKwwTys06UN2W0PXG4SiXqh694dLOetVFNx9IJ0EhEsQzeYXWxW9bhNK0 bNw4Qjq3Frk4xDQ9NeulWMqUhIIfm3SLuMOoPcequwKZ0px/18xMxgTt4S5DUUJpx8bk hiufhvhVm9XDrYc3wp2aE9Q0f1CZt5ZscerUZcvBIoqRTfQIwChzVpJ+p0DI3x1XfZ2A zNukpHffoPMFGnZwMfBsCFZGy2rOtsQrUQFexCEQe8o2gefFBxkZAiVaAWjcLsZ2wrmH hnWBituEhB6wjGA5XvuOTWgh/DEJ9bGzxtBGgvK9EvRfcm+DY488mUKF3bQXS47IVmgq H/Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :organization:message-id:date:subject:cc:to:from:dkim-signature; bh=KbbzsUvjOtyArmSR7nGExZ6GK9sziaFkDS0PPx3A3JI=; b=oqFY0mjZP0V0vYiu61AfRbP5FDjXVflmJYqjyT3/iSGlbCQCuj/5ATxyl+Kb9Te/PR D43U0zcuQY97Sq3timDxSATnOJHDA2diBh04h17n0pGEhmsuTihgteQI2ECgZwr8kZqr G1onKzg5ZLWkJcX+a+YdqlJ+iWvQ9KwZ9g8Bzvyy730NPYq4cmkoiDX4mtiS447fCG+n h7rrPepCCX9Q8wp3POS8dc+IfopU//yabEuhUZAv2jxS9bdvXFrqTmTKVdzBV9P/JJBL RLsxbCrth6jQKbu9RLi81BbVOcWabSfpqyxuWvM7a1cmxicnKoVf2CVTjf9pikZ+FR7d rQ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kdab.com header.s=dkim header.b=nzsctgUI; 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 c6-v6si11122498plr.91.2018.10.15.13.52.09; Mon, 15 Oct 2018 13:52:26 -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=nzsctgUI; 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 S1726165AbeJPEim (ORCPT + 99 others); Tue, 16 Oct 2018 00:38:42 -0400 Received: from mail.kdab.com ([176.9.126.58]:32355 "EHLO mail.kdab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbeJPEim (ORCPT ); Tue, 16 Oct 2018 00:38:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kdab.com; h= content-type:content-type:mime-version:references:in-reply-to :organization:message-id:date:date:subject:subject:from:from; s= dkim; t=1539636702; x=1540500703; bh=KbbzsUvjOtyArmSR7nGExZ6GK9s ziaFkDS0PPx3A3JI=; b=nzsctgUIv5D5AuMxDC68AyGdiSLWeHA4Gv5jjIwROEe s5HA7L4sGo+EK3+meGR2OYda7ujGzeNDbZPWnktHBC7hieVvJBY5CZp3c1axwcIy yex9eb1btbu3pDL29Jgk9tBZ/PoAYUJU4+cysB5REOlQaccTOHPcgbvSJSVn49dM = X-Virus-Scanned: amavisd-new at kdab.com From: Milian Wolff To: Arnaldo Carvalho de Melo Cc: jolsa@kernel.org, yao.jin@linux.intel.com, namhyung@kernel.org, Linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH 3/3] perf report: don't crash on invalid inline debug information Date: Mon, 15 Oct 2018 22:51:36 +0200 Message-ID: <4772069.7eSvdiorvC@agathebauer> Organization: KDAB In-Reply-To: <20181011193920.GA393@kernel.org> References: <20180926135207.30263-1-milian.wolff@kdab.com> <1768601.Weh5pZyhPy@agathebauer> <20181011193920.GA393@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6315378.hE6lbSLKzD"; micalg="sha256"; protocol="application/pkcs7-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart6315378.hE6lbSLKzD Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Donnerstag, 11. Oktober 2018 21:39:20 CEST Arnaldo Carvalho de Melo wrote: > Em Thu, Oct 11, 2018 at 08:23:31PM +0200, Milian Wolff escreveu: > > On Donnerstag, 27. September 2018 21:10:37 CEST Arnaldo Carvalho de Melo > > > > wrote: > > > Em Wed, Sep 26, 2018 at 03:52:07PM +0200, Milian Wolff escreveu: > > > > When the function name for an inline frame is invalid, we must > > > > not try to demangle this symbol, otherwise we crash with: > > > > > > > > #0 0x0000555555895c01 in bfd_demangle () > > > > #1 0x0000555555823262 in demangle_sym (dso=0x555555d92b90, > > > > elf_name=0x0, > > > > kmodule=0) at util/symbol-elf.c:215 #2 dso__demangle_sym > > > > (dso=dso@entry=0x555555d92b90, kmodule=, > > > > kmodule@entry=0, > > > > elf_name=elf_name@entry=0x0) at util/symbol-elf.c:400 #3 > > > > 0x00005555557fef4b in new_inline_sym (funcname=0x0, > > > > base_sym=0x555555d92b90, dso=0x555555d92b90) at util/srcline.c:89 #4 > > > > inline_list__append_dso_a2l (dso=dso@entry=0x555555c7bb00, > > > > node=node@entry=0x555555e31810, sym=sym@entry=0x555555d92b90) at > > > > util/srcline.c:264 #5 0x00005555557ff27f in addr2line > > > > (dso_name=dso_name@entry=0x555555d92430 > > > > "/home/milian/.debug/.build-id/f7/186d14bb94f3c6161c010926da66033d24fc > > > > e5/ > > > > elf", addr=addr@entry=2888, file=file@entry=0x0,> > > > > > > > > line=line@entry=0x0, dso=dso@entry=0x555555c7bb00, > > > > unwind_inlines=unwind_inlines@entry=true, node=0x555555e31810, > > > > sym=0x555555d92b90) at util/srcline.c:313> > > > > > > > > #6 0x00005555557ffe7c in addr2inlines (sym=0x555555d92b90, > > > > dso=0x555555c7bb00, addr=2888, dso_name=0x555555d92430 > > > > "/home/milian/.debug/.build-id/f7/186d14bb94f3c6161c010926da66033d24fc > > > > e5/ > > > > elf")> > > > > > > > > at util/srcline.c:358 > > > > > > > > So instead handle the case where we get invalid function names > > > > for inlined frames and use a fallback '??' function name instead. > > > > > > > > While this crash was originally reported by Hadrien for rust code, > > > > I can now also reproduce it with trivial C++ code. Indeed, it seems > > > > like libbfd fails to interpret the debug information for the inline > > > > frame symbol name: > > > > > > > > $ addr2line -e > > > > /home/milian/.debug/.build-id/f7/186d14bb94f3c6161c010926da66033d24fce > > > > 5/e > > > > lf -if b48 main > > > > /usr/include/c++/8.2.1/complex:610 > > > > ?? > > > > /usr/include/c++/8.2.1/complex:618 > > > > ?? > > > > /usr/include/c++/8.2.1/complex:675 > > > > ?? > > > > /usr/include/c++/8.2.1/complex:685 > > > > main > > > > /home/milian/projects/kdab/rnd/hotspot/tests/test-clients/cpp-inlining > > > > /mai > > > > n.cpp:39 > > > > > > > > I've reported this bug upstream and also attached a patch there > > > > which should fix this issue: > > > > https://sourceware.org/bugzilla/show_bug.cgi?id=23715 > > > > > > Millian, what about this one, which is the cset it is fixing? > > > > Hey Arnaldo, > > > > just noticed this email and that the corresponding patch hasn't landed in > > perf/core yet. The patch set which introduced this is a64489c56c307 ("perf > > report: Find the inline stack for a given address"). Note that the code > > was > > introduced by this patch, but then subsequently touched and moved by > > follow up patches. So, is this the patch you want to see referenced? > > Otherwise, the latest patch which gets fixed is afaik: 7285cf3325b4a > > ("perf srcline: Show correct function name for srcline of callchains"). > > > > Can you please pick either of these patches and amend the commit message > > of my patch and push it to perf/urgent and perf/core? > > I'll reread all this later or tomorrow and continue, going AFK now. Ping? -- Milian Wolff | milian.wolff@kdab.com | Senior Software Engineer KDAB (Deutschland) GmbH, a KDAB Group company Tel: +49-30-521325470 KDAB - The Qt, C++ and OpenGL Experts --nextPart6315378.hE6lbSLKzD Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCDEIw ggXmMIIDzqADAgECAhBqm+E4O/8ra58B1dm4p1JWMA0GCSqGSIb3DQEBDAUAMIGFMQswCQYDVQQG EwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYD VQQKExFDT01PRE8gQ0EgTGltaXRlZDErMCkGA1UEAxMiQ09NT0RPIFJTQSBDZXJ0aWZpY2F0aW9u IEF1dGhvcml0eTAeFw0xMzAxMTAwMDAwMDBaFw0yODAxMDkyMzU5NTlaMIGXMQswCQYDVQQGEwJH QjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQK ExFDT01PRE8gQ0EgTGltaXRlZDE9MDsGA1UEAxM0Q09NT0RPIFJTQSBDbGllbnQgQXV0aGVudGlj YXRpb24gYW5kIFNlY3VyZSBFbWFpbCBDQTCCASIwDQYJKoZI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