Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2457298imd; Fri, 2 Nov 2018 11:44:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5dOenGvhN6DLR1/SnKYr0TrHOrXPEWfvFuYYPZsjGMLkZ8Jdg5bxMadYXVybjL0ZEI6DQ1w X-Received: by 2002:a17:902:a984:: with SMTP id bh4-v6mr12822298plb.163.1541184246147; Fri, 02 Nov 2018 11:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184246; cv=none; d=google.com; s=arc-20160816; b=uKw9Ni+l37VfeoLtA7uw+1a+PdS8nWLRGUNpJzP6bXZJDaeCpnjs5ucvyqnX2ZbvFZ zzPuErgFwf5INcjwxxl4oKHzgc+WM4UW9w5xAfiZkfLZJ+dZFk/lZfZP4ywg+avyrLXq AqKg+IFUSLffW6iA+u1Ht6B/6KARG3izpIJmAikLyyeaxpG3CsTxzyUU3OSrfPvFs5VP d3FrGbR3R/Ks6YGqKTPg7CqIopq7p/BOLAN7nkkQLueAJAjjiLS4IJ6s0dAX5b51Lx6/ KIrUrlZeCDk4DHc6xWO2UU7dsTM7s2ebrWoj47wUlTwenVtXhKgkTO3WuHpopmguna6u 4EWg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=41KyZZWg3l6TVAFjY254bAwU3o5fD+NDPBNOxVzbnGk=; b=JeIoUISrhhSCMmwDmU+g+klGPsIml+VrVRPWlCASngh/JoYN5CYShdYyJclZjo9tRt ur+d/9afcQM+j39o80U2Gg2/CySf41SByUvGoAJXb4/pTDNF12xXJd7E0GSa4tbGkaRt LpdKf5QBn5EJUiiKG/ctj1gkfAPgHDVsOA/KBmslPtTTtplS8+DfF2GofUhGXLhMx6Wg G4+a3GXBcFOU6zNuSQ8hV/xsbD+bT5estlLgCnYo4ilyvMVVQMaOfT3QjbakHeTq2E4n IV/G3tn2LnWGynHQhHQrcbwq9jc7VHVB+QeMGvcghcyugJOM2uGWd4peEzOdP1Im5aWu T+tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hs7vo1nx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si1870284plh.96.2018.11.02.11.43.51; Fri, 02 Nov 2018 11:44:06 -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=@kernel.org header.s=default header.b=hs7vo1nx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729136AbeKCDto (ORCPT + 99 others); Fri, 2 Nov 2018 23:49:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:44454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728699AbeKCDtn (ORCPT ); Fri, 2 Nov 2018 23:49:43 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF2762084A; Fri, 2 Nov 2018 18:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184091; bh=z8VLiXprTnqDZZ4AZ3ID2ghZihHHS86MvQEecjqJneg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hs7vo1nxj0KQ46boUtf1iUEP50+a556sWt0AzPNCloc3TIsmG80ic2VKo6z002Rf3 /Mrg8ol5N41p/u8IiExMrrZpyTsDI/SrqOsa/bNNUW+b49ek2yjHeHe9R2ToC0LfyS 0RI25/MbZQeK5c17gqSezJQtomX2/NZfcXGyIibg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Milian Wolff , Sandipan Das , Jiri Olsa , Jin Yao , Namhyung Kim , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.18 076/150] perf report: Dont try to map ip to invalid map Date: Fri, 2 Nov 2018 19:33:58 +0100 Message-Id: <20181102182908.880402846@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ff4ce2885af8f9e8e99864d78dbeb4673f089c76 ] Fixes a crash when the report encounters an address that could not be associated with an mmaped region: #0 0x00005555557bdc4a in callchain_srcline (ip=, sym=0x0, map=0x0) at util/machine.c:2329 #1 unwind_entry (entry=entry@entry=0x7fffffff9180, arg=arg@entry=0x7ffff5642498) at util/machine.c:2329 #2 0x00005555558370af in entry (arg=0x7ffff5642498, cb=0x5555557bdb50 , thread=, ip=18446744073709551615) at util/unwind-libunwind-local.c:586 #3 get_entries (ui=ui@entry=0x7fffffff9620, cb=0x5555557bdb50 , arg=0x7ffff5642498, max_stack=) at util/unwind-libunwind-local.c:703 #4 0x0000555555837192 in _unwind__get_entries (cb=, arg=, thread=, data=, max_stack=) at util/unwind-libunwind-local.c:725 #5 0x00005555557c310f in thread__resolve_callchain_unwind (max_stack=127, sample=0x7fffffff9830, evsel=0x555555c7b3b0, cursor=0x7ffff5642498, thread=0x555555c7f6f0) at util/machine.c:2351 #6 thread__resolve_callchain (thread=0x555555c7f6f0, cursor=0x7ffff5642498, evsel=0x555555c7b3b0, sample=0x7fffffff9830, parent=0x7fffffff97b8, root_al=0x7fffffff9750, max_stack=127) at util/machine.c:2378 #7 0x00005555557ba4ee in sample__resolve_callchain (sample=, cursor=, parent=parent@entry=0x7fffffff97b8, evsel=, al=al@entry=0x7fffffff9750, max_stack=) at util/callchain.c:1085 Signed-off-by: Milian Wolff Tested-by: Sandipan Das Acked-by: Jiri Olsa Cc: Jin Yao Cc: Namhyung Kim Fixes: 2a9d5050dc84 ("perf script: Show correct offsets for DWARF-based unwinding") Link: http://lkml.kernel.org/r/20180926135207.30263-1-milian.wolff@kdab.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- 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 22dbb6612b41..d49744dc46d7 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2272,7 +2272,7 @@ static int unwind_entry(struct unwind_entry *entry, void *arg) { struct callchain_cursor *cursor = arg; const char *srcline = NULL; - u64 addr; + u64 addr = entry->ip; if (symbol_conf.hide_unresolved && entry->sym == NULL) return 0; @@ -2284,7 +2284,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 = map__map_ip(entry->map, entry->ip); + if (entry->map) + addr = map__map_ip(entry->map, entry->ip); srcline = callchain_srcline(entry->map, entry->sym, addr); return callchain_cursor_append(cursor, entry->ip, -- 2.17.1