Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5922812ybh; Wed, 7 Aug 2019 13:52:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxe6e+Ii6+q/Tm2MlmA3AbkH0hQCoWfeup+Zjph6eKnZaadJhqoVnKQBrtd8ey9xNCdkDaY X-Received: by 2002:a62:5c01:: with SMTP id q1mr11436719pfb.53.1565211173728; Wed, 07 Aug 2019 13:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565211173; cv=none; d=google.com; s=arc-20160816; b=YR5maJ4cEkZz+Grylw/7Gp6HY2z1Zsj8Dd9bntsClnQtXQviq1Gl5g38Jn4NWxhptY r2Q6XUvFUEMY5O+ftGynVWRoI8nUqMwmclihMr+paGpZ/F+oxKibfWS2b9S5V19L8wcj 44oXlHNCpHQsuFg7Ze5BqJxPye2J3XapFS+QlcoL38vmEEg1HuSH2P0fx24mBgl78rmk k9SFdmDyDyxeyTwUiuoXf/1EXNjcKtOzmZXAnTKpEbDlYhrSYN1pcbNYwEI85CtbGIzL R3QQJnA8GP6pEdlWufEFatob0lJWh4v87p+Adtr/pAVfWZShFXqHRMOLhc5RX/vBO6z0 9wJw== 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:date:from:dkim-signature; bh=JnfmvZ/QcYu98dNScUIPb4GqbadlayALh7C9ra9pyek=; b=CvMYCeqyx/5kWOttw8JrvdAyzHnTDc4ynTWk7EI+ddjFgwSeV8Mb23sdEzzxjJ20eq E5wHoKnmgO7pyi95vvYkdb8mFxYyEk7E8/N3FVjJTutDyc46UI2K4StR1qu65NaIza6S oPr5DDZpTTYjuyvsUO4i551g0jab5y5SbuI6EBacOTjA02E3DtdB/CDmZfccjCcZQpXo aGl1+ke2BdaXual+FAzCXcHUP4L1AdMtaQfcbVSRPYhrF53sCvsVYV9p5G6CCEI1d3GW fIFLyrctk2F5gxeWzfgWfjyhwtVMfXWnUIJmuuAO4IB16D3RZaGcQIlH8rmKD1ddsAoz Ux2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B8c7LUNK; 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 m7si50027625pls.110.2019.08.07.13.52.37; Wed, 07 Aug 2019 13:52:53 -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=B8c7LUNK; 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 S2389445AbfHGUiV (ORCPT + 99 others); Wed, 7 Aug 2019 16:38:21 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36405 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387957AbfHGUiV (ORCPT ); Wed, 7 Aug 2019 16:38:21 -0400 Received: by mail-qt1-f195.google.com with SMTP id z4so89862418qtc.3 for ; Wed, 07 Aug 2019 13:38:20 -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:user-agent; bh=JnfmvZ/QcYu98dNScUIPb4GqbadlayALh7C9ra9pyek=; b=B8c7LUNKNlZdnbVtnDPnClulOqJvhEKi/10aIP/4G8L4X6S3+qhU9kla5p7GTfn2D4 IcEyJUOaijl5bh5Y9o+seprK9/DXAiLRpgyVO/UY7zqW4Y9mUTM1fvMqODM9KN3bjLkD mrLcXhV/PJ0FTFxivuGvBSmTurobtwme2xhfAa4TZDrk3RoDE+4zJEH+KfS4bPU+T9/S aSbXnWdGsHwZxLVNqc56pywauNawGOaowOVQwBJ2rTWgjE0Z5f6C5lB50dwin7J1fnJN dyCBYMD4Fg0Z+lv0qeI3L8+fXaQj+wrzIYqp1vzytsQvwu6OAESRkgg9EZ0OZxGnM703 eA+g== 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:user-agent; bh=JnfmvZ/QcYu98dNScUIPb4GqbadlayALh7C9ra9pyek=; b=ZYmisazJ9MN3wRv9OlF87Bwg/zaD4vgTVuaM28ooA2TljZ5FQZbUdyS7fxKJ4ORtK2 902b+gWEnMzxkktgg10Jybk2y3f6C+2W5ygIHfi60mYFAO70U1MEPEISAcDiglgTdKgH yeKavepxwpwO/L3OCwGMcfepP72A4lnxpmgOmq1wcZ6r/Ccxe6teD85Ifdd6j/KeFBN/ ChgD4LHMeqFoqN8OujJBzsiH0eUDyPf1PFjKkj5iFe0BbDaRHgTK7Jd2CzuLj4Cw7bBK uAHvVuZZwEyF39fp7Pgj6U5S6dS9izOj7i3JMiiEt485MRY2NqkgmIuzOuEnqiu00euc r9dA== X-Gm-Message-State: APjAAAVHxFRjrqFwiqAkVVOQr/M0KCRyOMxZgW38zYIkDYF6l5bHXk7Q tWMoPNT1hMZ7cMF8ItwCR7Y= X-Received: by 2002:ac8:c0e:: with SMTP id k14mr9939429qti.72.1565210299795; Wed, 07 Aug 2019 13:38:19 -0700 (PDT) Received: from quaco.ghostprotocols.net ([177.195.208.151]) by smtp.gmail.com with ESMTPSA id i5sm36780060qtp.20.2019.08.07.13.38.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 07 Aug 2019 13:38:16 -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 0F9C240340; Wed, 7 Aug 2019 17:38:13 -0300 (-03) Date: Wed, 7 Aug 2019 17:38:12 -0300 To: Numfor Mbiziwo-Tiapo Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, songliubraving@fb.com, mbd@fb.com, linux-kernel@vger.kernel.org, irogers@google.com, eranian@google.com Subject: Re: [PATCH 0/3] Perf uninitialized value fixes Message-ID: <20190807203812.GA20129@kernel.org> References: <20190724234500.253358-1-nums@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190724234500.253358-1-nums@google.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Jul 24, 2019 at 04:44:57PM -0700, Numfor Mbiziwo-Tiapo escreveu: > These patches are all warnings that the MSAN (Memory Sanitizer) build > of perf has caught. > > To build perf with MSAN enabled run: > make -C tools/perf CLANG=1 CC=clang EXTRA_CFLAGS="-fsanitize=memory\ > -fsanitize-memory-track-origins" > > (The -fsanitizer-memory-track-origins makes the bugs clearer but > isn't strictly necessary.) > > (Additionally, llvm might have to be installed and clang might have to > be specified as the compiler - export CC=/usr/bin/clang). > > The patches "Fix util.c use of uninitialized value warning" and "Fix > annotate.c use of uninitialized value error" build on top of each other > (the changes in Fix util.c use of uninitialized value warning must be > made first). > > When running the commands provided in the repro instructions, MSAN will > generate false positive uninitialized memory errors. This is happening > because libc is not MSAN-instrumented. Finding a way to build libc with > MSAN will get rid of these false positives and allow the real warnings > mentioned in the patches to be shown. So this is because I'm not running a glibc linked with MSAN? Do you have any pointer to help building glibc with MSAN? I want to do that inside a container so that I can use these sanitizers, thanks, [root@quaco ~]# perf record -o - ls / | perf --no-pager annotate -i - --stdio ==29732==WARNING: MemorySanitizer: use-of-uninitialized-value ==29733==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0xcc136d in add_path /home/acme/git/perf/tools/lib/subcmd/exec-cmd.c:130:6 #1 0xcc075e in setup_path /home/acme/git/perf/tools/lib/subcmd/exec-cmd.c:146:2 #2 0x71298d in main /home/acme/git/perf/tools/perf/perf.c:512:2 #0 0xcc136d in add_path /home/acme/git/perf/tools/lib/subcmd/exec-cmd.c:130:6 #1 0xcc075e in setup_path /home/acme/git/perf/tools/lib/subcmd/exec-cmd.c:146:2 #2 0x71298d in main /home/acme/git/perf/tools/perf/perf.c:512:2 #3 0x7f45b9e29f32 in __libc_start_main (/lib64/libc.so.6+0x23f32) #4 0x447dcd in _start (/home/acme/bin/perf+0x447dcd) Uninitialized value was created by a heap allocation #3 0x7fd6433cff32 in __libc_start_main (/lib64/libc.so.6+0x23f32) #4 0x447dcd in _start (/home/acme/bin/perf+0x447dcd) Uninitialized value was created by a heap allocation #0 0x4507d2 in malloc /home/acme/git/llvm/projects/compiler-rt/lib/msan/msan_interceptors.cc:916:3 #1 0x7f45b9e7fc47 in __vasprintf_internal (/lib64/libc.so.6+0x79c47) SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/acme/git/perf/tools/lib/subcmd/exec-cmd.c:130:6 in add_path Exiting #0 0x4507d2 in malloc /home/acme/git/llvm/projects/compiler-rt/lib/msan/msan_interceptors.cc:916:3 #1 0x7fd643425c47 in __vasprintf_internal (/lib64/libc.so.6+0x79c47) SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/acme/git/perf/tools/lib/subcmd/exec-cmd.c:130:6 in add_path Exiting [root@quaco ~]# > Numfor Mbiziwo-Tiapo (3): > Fix util.c use of uninitialized value warning > Fix annotate.c use of uninitialized value error > Fix sched-messaging.c use of uninitialized value errors > > tools/perf/bench/sched-messaging.c | 3 ++- > tools/perf/util/annotate.c | 15 +++++++++++---- > tools/perf/util/header.c | 2 +- > 3 files changed, 14 insertions(+), 6 deletions(-) > > -- > 2.22.0.657.g960e92d24f-goog -- - Arnaldo