Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1840464ybb; Thu, 2 Apr 2020 08:17:39 -0700 (PDT) X-Google-Smtp-Source: APiQypJaYKZ5/iUftLYpxuRMiIBazFSlPS+gn7xbBca6F5NPCTvqmxVsPGGHw++SaL3PCdAdJXGm X-Received: by 2002:a4a:92cd:: with SMTP id j13mr3194519ooh.96.1585840659266; Thu, 02 Apr 2020 08:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585840659; cv=none; d=google.com; s=arc-20160816; b=dx6uv23rlZ2FanmhFQVdguorFbS1I79/lM6OrSIRmrxVvK5w+iYDJNlChyzc2IbbEe +Qu/LyEYBdwjuAUjb6yWvMdoHz+ZtXVTJkpYmK2HgwWYJFR5MCfLm36iMC42wtiDbuFt v06lN7yu3FNJt7vjyvpBW2tFzBa14opBy1cR7nckWh32L+LV5gfnG68dTI5n9RKWNtq3 s/P5azg9Ci/pZRqH8/S/ZLEuNhWveDGzJhzIBaQumh2Ajvv359kmbZ9CisV6Q/Tdg81s L1kIJBrXVpTXogmU8XIzSz49okzNAdO2w8rnswPh9XoMV1eaEe29t1WkXkhcBew2EbUP akmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=d4XEhzJwWS1gTxtxswDRDBuJHjNbQq0+6erxkcN6aEQ=; b=geNF0Q9/96+6GixgEcQv8tVhz9Kq9msxLSHS8eKu7WRE15rOZlPd0PZievulICC/Gs x6dgUAP3vX/u4ktLC3UrO0HDF8BbPfebaqFHrWiY+c+CD7oPik0yCveI5KzYudpmJFop bB8c3m98QcYmJ92sdZmMkACwsykHyS4mcCKaOaPYaCti1lscszjI2oewV9dQdnB6Q02q PELecQ8vHnlOjYhxsnX3DboxBTeWJiIQbbOKM4pvHE712FGsuT+pX1en4kQPPkuocruv b4wPr4n77fyCewgYZis7sGArmCF4GlSd7nerhL6daQ0+zbp4QKUoaMcw0NDZaWA6oqVw YCFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CwhMaNmj; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j15si2520639ots.187.2020.04.02.08.17.22; Thu, 02 Apr 2020 08:17:39 -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=@gmail.com header.s=20161025 header.b=CwhMaNmj; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389109AbgDBPQr (ORCPT + 99 others); Thu, 2 Apr 2020 11:16:47 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:39373 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389053AbgDBPQr (ORCPT ); Thu, 2 Apr 2020 11:16:47 -0400 Received: by mail-qt1-f193.google.com with SMTP id f20so3542072qtq.6; Thu, 02 Apr 2020 08:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=d4XEhzJwWS1gTxtxswDRDBuJHjNbQq0+6erxkcN6aEQ=; b=CwhMaNmj75v9ZsdgR2qqkblPwTyg4JsSTe/GMmCY/hNzObGKALD7q4tlr26S0tLRYb gUh7Ulrl3ab8k6OpwP7caM2LpHf43nCv77KMA5pJ/bzeK2Q0a+K7Abs9OCaP9ZEUFiet gUOcNT9hqjdkBAm7pqinIX9Q4v07qIIMKN0EfV3+AyEOu71rrZ8T8/+mjXzYjZ2zUZ6B AoOaI3UNawOFXEfY90yRAtr0RBSFRz+YVvAQnuv1lHThylhglIfJ4UUCZfEJs2GMTC4D 5t0UzRWNt7qjoJ2uYPngPTliCqVSVge2pDaamQ/HtsJ1hbaBTeL+Q4r71KGZnIJJuZdi 32Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=d4XEhzJwWS1gTxtxswDRDBuJHjNbQq0+6erxkcN6aEQ=; b=U0J/aZ9MlFYQ4VpnjXQIBSXyhawD+pFRnWS9pOPI+Uups5cdcpxze26S6VzARAvojm pyZilWfiD6i6hHtmNNBgnnv6MRdi1IbKSa4DOauV2Rvs95Vvsfg/gZThoczfdKETRqGm mKWn4BxHPpEWg3qmws/B0Zue0aGakYLooHLCkxHqXmp35WVhwLFer9TL8t8h/rH+Uxxz PYZ9PLNFLHulBoheb3dPmpArwd4+TBnJBY4H4cVhIyQiCcwAxsV6FopmykS0AAvz2BRr 1w+Bhma5UsZ6q6XQEi5tIX8SI99RzgsFDSHN52P7Lgblgkp5QJpfCnTE6X/xxCJvw0uF EQUQ== X-Gm-Message-State: AGi0PubN2JEtw8kke9v/FS1R3bgDyyI8LVlwWj/QLQRGeKI6GHZw1bt6 9psdsAa0DXIqM2iIlLq+onk= X-Received: by 2002:aed:2314:: with SMTP id h20mr3494425qtc.184.1585840605945; Thu, 02 Apr 2020 08:16:45 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id s26sm3597919qkm.114.2020.04.02.08.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 08:16:45 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 6D058409A3; Thu, 2 Apr 2020 12:16:43 -0300 (-03) Date: Thu, 2 Apr 2020 12:16:43 -0300 To: Andreas Gerstmayr Cc: linux-perf-users@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , "Steven Rostedt (VMware)" , Kan Liang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf script report: fix segfault when using DWARF mode Message-ID: <20200402151643.GB8736@kernel.org> References: <05e0d633-54b4-fb3b-3d08-8963271017ea@amd.com> <20200402125417.422232-1-agerstmayr@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200402125417.422232-1-agerstmayr@redhat.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Apr 02, 2020 at 02:54:16PM +0200, Andreas Gerstmayr escreveu: > When running perf script report with a Python script and a callgraph in > DWARF mode, intr_regs->regs can be 0 and therefore crashing the regs_map > function. > > Added a check for this condition (same check as in builtin-script.c:595). Thanks, applied to perf/urgent. - Arnaldo > Signed-off-by: Andreas Gerstmayr > --- > tools/perf/util/scripting-engines/trace-event-python.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c > index 8c1b27cd8b99..2c372cf5495e 100644 > --- a/tools/perf/util/scripting-engines/trace-event-python.c > +++ b/tools/perf/util/scripting-engines/trace-event-python.c > @@ -694,6 +694,9 @@ static int regs_map(struct regs_dump *regs, uint64_t mask, char *bf, int size) > > bf[0] = 0; > > + if (!regs || !regs->regs) > + return 0; > + > for_each_set_bit(r, (unsigned long *) &mask, sizeof(mask) * 8) { > u64 val = regs->regs[i++]; > > -- > 2.25.1 > -- - Arnaldo