Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp565256imm; Wed, 10 Oct 2018 00:15:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV63CSGih8oML2DkkffuzYTELphYbwsOoMtaopG0oZsGrkM6VDyasEPhYMujsPfiV7OqvsKF1 X-Received: by 2002:a62:c957:: with SMTP id k84-v6mr34488693pfg.205.1539155758570; Wed, 10 Oct 2018 00:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539155758; cv=none; d=google.com; s=arc-20160816; b=i2WMJlcm98jWQgfQGe7AvysUlrqjb+fEz/Sfh06qchWyDFxSOZrR4nuDJY7ZZEC/76 QACOEyeehI80U6UpqgFu9Ry8jyFeMkYzSPi7vWTVd+qX3mmErY0GARmbrrvtlcvckaJ7 LU1FrF/Ie5/3KH2U3D4a2ra9tqLApLNvL8irFanFaR1+uCI6xrvTjWbPDxRQcP1iUfFh nJOG5wATrE/HoVFRvzeF6EG1qAT5QgvIsWPMRxBb4/Sp/FLmUqbmdD+ik8IkTt+ev/NN 3lBsmp5ndbo1SVeveOT6cO3KkTy4kVN9Rzq4twAKQrdUsI5I3dCekMGMjex9WWo69Mit jrQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0wBIFlkjmvG5JcomKbyNy0vzgJaN03pzwKCJgzUcyHA=; b=YcDbKBNbQg5t371wx+JoDboS4Vk7rzi2kNb8N6mVxjmDqwGhHoJaCBBYmwdoNnDcew bGEgrcU3I2VBoKEQy9KJNy96iaNclWHkzRak7o+NAa0p7DMKanJmMw3camTqnHzWicY5 YSDR2bpQoettfoxrntlHlBXG00APr5SuFONXkB7y0zmhBLp1Tl8+M4E1Nl8THoCkNujB UVGSRUN8eOycbNXyxYZouJe8wVe/Y0411rN5/p91QkiLa+iqtPXj4gQ5CjKBhfeo2tdX x31kl2ibldLldV0cHtd8Tx6dGYFnGWMw+qqg1labQ6YgolhFk1xDys/5I3xi2XLhA2ew jJpw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7-v6si22862915ply.150.2018.10.10.00.15.43; Wed, 10 Oct 2018 00:15:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726921AbeJJOfw (ORCPT + 99 others); Wed, 10 Oct 2018 10:35:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726699AbeJJOfv (ORCPT ); Wed, 10 Oct 2018 10:35:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B5A883F46; Wed, 10 Oct 2018 07:15:03 +0000 (UTC) Received: from krava (unknown [10.43.17.150]) by smtp.corp.redhat.com (Postfix) with SMTP id 9266417DF3; Wed, 10 Oct 2018 07:14:59 +0000 (UTC) Date: Wed, 10 Oct 2018 09:14:58 +0200 From: Jiri Olsa To: Sandipan Das Cc: Anthony LaTorre , peterz@infradead.org, mingo@redhat.com, jolsa@kernel.org, acme@kernel.org, alexander.shishkin@linux.intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, Ravi Bangoria , Milian Wolff Subject: Re: perf report segfault Message-ID: <20181010071458.GA15790@krava> References: <20181009164743.GA22886@krava> <20181009214158.GB31206@krava> <20181009222004.GA19295@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 10 Oct 2018 07:15:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 10, 2018 at 11:13:47AM +0530, Sandipan Das wrote: > Hi Jiri, > > Yes, this happens when entry->map is NULL. While your fix seems correct, the > following commit from Milian Wolff had already addressed this. I think this > was pulled in with one of Arnaldo's recent perf/urgent updates. > > ff4ce2885af8 ("perf report: Don't try to map ip to invalid map") > > Adding Milian to the loop as well. yea.. I knew I saw that code just recently ;-) thanks, jirka > > With Regards, > Sandipan > > On 10/10/18 3:50 AM, Jiri Olsa wrote: > > On Tue, Oct 09, 2018 at 04:47:31PM -0500, Anthony LaTorre wrote: > >> I can try building perf from the latest sources. I've attached the > >> perf.data and perf.data.tar.bz2 from the test program I sent earlier. > > > > cool, reproduced.. it seems to get introduced by: > > 2a9d5050dc84 perf script: Show correct offsets for DWARF-based unwinding > > > > reverting that patch fixes the issue for me, but looks like > > we could just make th attached check and prevent the crash > > > > adding Sandipan Das to the loop, the author of that commit, any idea? > > > > thanks, > > jirka > > > > > > --- > > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c > > index c4acd2001db0..ea68c805c7ac 100644 > > --- a/tools/perf/util/machine.c > > +++ b/tools/perf/util/machine.c > > @@ -2312,7 +2312,6 @@ static int unwind_entry(struct unwind_entry *entry, void *arg) > > { > > struct callchain_cursor *cursor = arg; > > const char *srcline = NULL; > > - u64 addr; > > > > if (symbol_conf.hide_unresolved && entry->sym == NULL) > > return 0; > > @@ -2320,13 +2319,15 @@ static int unwind_entry(struct unwind_entry *entry, void *arg) > > if (append_inlines(cursor, entry->map, entry->sym, entry->ip) == 0) > > return 0; > > > > - /* > > - * Convert entry->ip from a virtual address to an offset in > > - * its corresponding binary. > > - */ > > - addr = map__map_ip(entry->map, entry->ip); > > + if (entry->map) { > > + /* > > + * Convert entry->ip from a virtual address to an offset in > > + * its corresponding binary. > > + */ > > + u64 addr = map__map_ip(entry->map, entry->ip); > > + srcline = callchain_srcline(entry->map, entry->sym, addr); > > + } > > > > - srcline = callchain_srcline(entry->map, entry->sym, addr); > > return callchain_cursor_append(cursor, entry->ip, > > entry->map, entry->sym, > > false, NULL, 0, 0, 0, srcline); > > >