From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC0B1C2D0A8 for ; Mon, 28 Sep 2020 12:24:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6018F2100A for ; Mon, 28 Sep 2020 12:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601295876; bh=OrXbJTapS7yR5pyQlnzNt+q7HGyOAbUUOE+BlMZaoHY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=ELKU3EDcDONkcoiCllIsHh5pactn1/bEZtfXLrOYUqAVXfh4zAK77mAaeUoCGbE1P kPgFIUSKykPh3oN0GkLKqLczVk/eVhTbiyibPYI9LgkB9PIGU7VAHUIsuCj+oAw2pu JfwV+qP0TghP+2WR71YTzWkvgTn+3A0kevbFf6lQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbgI1MYf (ORCPT ); Mon, 28 Sep 2020 08:24:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:56462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgI1MYf (ORCPT ); Mon, 28 Sep 2020 08:24:35 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (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 299FD2083B; Mon, 28 Sep 2020 12:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601295874; bh=OrXbJTapS7yR5pyQlnzNt+q7HGyOAbUUOE+BlMZaoHY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tW6aT/rOuY8uZbX8yCp4mnprPAOrGhqfHQIKXUkIemft/FZYcAFdOyvjnkZlLI3H2 jY9U9qGs1PKrD8Q/H75ClDgpuwhA6w2WvAgmcmmk0b/FxHYEozyITu18vXTKPPHuh6 Wrd0xxMQvQTrxR+icN7VcqZitBos5D9nGe0ds1ec= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 0E39C400E9; Mon, 28 Sep 2020 09:24:32 -0300 (-03) Date: Mon, 28 Sep 2020 09:24:31 -0300 From: Arnaldo Carvalho de Melo To: Nick Desaulniers Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , LKML , clang-built-linux , Stephane Eranian Subject: Re: [PATCH] perf test: Fix msan uninitialized use. Message-ID: <20200928122431.GD3087422@kernel.org> References: <20200923210655.4143682-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Sep 23, 2020 at 04:37:08PM -0700, Nick Desaulniers escreveu: > On Wed, Sep 23, 2020 at 2:07 PM 'Ian Rogers' via Clang Built Linux > wrote: > > > > Ensure 'st' is initialized before an error branch is taken. > > Fixes test "67: Parse and process metrics" with LLVM msan: > > ==6757==WARNING: MemorySanitizer: use-of-uninitialized-value > > #0 0x5570edae947d in rblist__exit tools/perf/util/rblist.c:114:2 > > #1 0x5570edb1c6e8 in runtime_stat__exit tools/perf/util/stat-shadow.c:141:2 > > #2 0x5570ed92cfae in __compute_metric tools/perf/tests/parse-metric.c:187:2 > > #3 0x5570ed92cb74 in compute_metric tools/perf/tests/parse-metric.c:196:9 > > #4 0x5570ed92c6d8 in test_recursion_fail tools/perf/tests/parse-metric.c:318:2 > > #5 0x5570ed92b8c8 in test__parse_metric tools/perf/tests/parse-metric.c:356:2 > > #6 0x5570ed8de8c1 in run_test tools/perf/tests/builtin-test.c:410:9 > > #7 0x5570ed8ddadf in test_and_print tools/perf/tests/builtin-test.c:440:9 > > #8 0x5570ed8dca04 in __cmd_test tools/perf/tests/builtin-test.c:661:4 > > #9 0x5570ed8dbc07 in cmd_test tools/perf/tests/builtin-test.c:807:9 > > #10 0x5570ed7326cc in run_builtin tools/perf/perf.c:313:11 > > #11 0x5570ed731639 in handle_internal_command tools/perf/perf.c:365:8 > > #12 0x5570ed7323cd in run_argv tools/perf/perf.c:409:2 > > #13 0x5570ed731076 in main tools/perf/perf.c:539:3 > > > > Fixes: commit f5a56570a3f2 ("perf test: Fix memory leaks in parse-metric test") > > Signed-off-by: Ian Rogers > > Reviewed-by: Nick Desaulniers Thanks, applied. - Arnaldo > Orthogonal: > The case where metricgroup__parse_groups_test() can fail in > __compute_metric() also looks curious. Should &metric_events be passed > to metricgroup__rblist_exit() in that case? > > > --- > > tools/perf/tests/parse-metric.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/tests/parse-metric.c b/tools/perf/tests/parse-metric.c > > index aea4f970fccc..7c1bde01cb50 100644 > > --- a/tools/perf/tests/parse-metric.c > > +++ b/tools/perf/tests/parse-metric.c > > @@ -157,6 +157,7 @@ static int __compute_metric(const char *name, struct value *vals, > > } > > > > perf_evlist__set_maps(&evlist->core, cpus, NULL); > > + runtime_stat__init(&st); > > > > /* Parse the metric into metric_events list. */ > > err = metricgroup__parse_groups_test(evlist, &map, name, > > @@ -170,7 +171,6 @@ static int __compute_metric(const char *name, struct value *vals, > > goto out; > > > > /* Load the runtime stats with given numbers for events. */ > > - runtime_stat__init(&st); > > load_runtime_stat(&st, evlist, vals); > > > > /* And execute the metric */ > > -- > > 2.28.0.681.g6f77f65b4e-goog > > > > -- > > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200923210655.4143682-1-irogers%40google.com. > > > > -- > Thanks, > ~Nick Desaulniers -- - Arnaldo