Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10416735ybi; Wed, 24 Jul 2019 22:50:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyS0hyWYzlkmKtMijtfmm7l2B9xoi/z/5A5GBGjhrl4nkbFYtxek9OPpBqCedFBigOfcNmi X-Received: by 2002:a62:483:: with SMTP id 125mr15382826pfe.245.1564033838401; Wed, 24 Jul 2019 22:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564033838; cv=none; d=google.com; s=arc-20160816; b=cxE5MH2zT+/kJKhnH/RV2X1UZwSEl84mmmli8U+fRxiXtyZregOa2T73omPwrdHGM6 FYPdu7flJfdZ60RVUnF8FSCrOOvb+/kz3qP+nf/ri893U2PWvdPth9sBsxDzJor2qQ9O mVtOL2QQh0fqXP1ncKrFadXn1PRUu5sRL4OMMb837bPTMko7S7LpVM0fRFQZ4FgJFjoe edCDFbS6wnD/g8FzVHbsZHimvefT5BJstE9SodMD6cO1FgP7X7Pt2F0uTMnHgn8HgHpm 711GAdS9KiKwZedHv1rydS1XBd3hqf9xDurL/d6ughVQP742DEJF9ent6OlvS9guabnf WJVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=GsusRCebKftTZon46v3ZWIHJN0uYkKUK209eUAX0ooM=; b=XVTsSNjDkeZkVA8dWyM+NH+FOHNNx/v03yh4/ziMqy7g5Qwe51rQti0gEXc8YUBrP0 a4PMREd5UBTyyJatp5sVbQE0sGuwSuun69xMrlxdJy5iB8CiiqpGpfvtJU54jwM4mFRd aWlRkwflqo6AoFa5zk4PgxPqK3TBvzN6ghwVAMULPYgJI5RZ8l9B89/zd59bEfQtf+3M ZKmLwxuoCs1MafxGi7xKbouV81KS9a3PCp/1dofeQQdr2Bx3V9MpDrUTqfC9QiNDZwnp HiXZQTad+cXQJyiXv4i9Pk6/SYUB6GmZt+FMHi08RL9jiXgAWY6hYLW+o29yChRilT8I WAhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=B1lXYQsc; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si15469564plp.329.2019.07.24.22.50.24; Wed, 24 Jul 2019 22:50:38 -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=@google.com header.s=20161025 header.b=B1lXYQsc; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387647AbfGXXpF (ORCPT + 99 others); Wed, 24 Jul 2019 19:45:05 -0400 Received: from mail-pf1-f202.google.com ([209.85.210.202]:42089 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbfGXXpF (ORCPT ); Wed, 24 Jul 2019 19:45:05 -0400 Received: by mail-pf1-f202.google.com with SMTP id 21so29577427pfu.9 for ; Wed, 24 Jul 2019 16:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=GsusRCebKftTZon46v3ZWIHJN0uYkKUK209eUAX0ooM=; b=B1lXYQsc/LR94o2K8zpnGLTTgfWtDcLlDAn0OQ7TSesRexUMZCK2ldktGPUDi3v24L UQKCPpY38Wwesil6AX13EJvvDVC2l1UFjEmMIw70UEZ+DcN5s2p2/mPTT+nI+XlrbwV0 uU8i6zW0eTXqSpG9fMwKuChsZHG/ghe+h1Tn7JO4noRWe9LQse+7A2GLxBPLPs8MuVcS XaXNlQdg5SgrUyRsYwN+2GJm/OrOJv0zU70rPQvwTsR9yeInU2S2S2MsGt7vJIzFBoai KekF9eidTCSCWbLBuCBwIbLe58ePuTZjAcefIqkXirP4P6dD8f6wl1btQg8Wf2pWngc4 1enA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=GsusRCebKftTZon46v3ZWIHJN0uYkKUK209eUAX0ooM=; b=dUeQ/1w9QUZvvHV2vg4R8djq8aOpdhq5tMxXrNCSPB9tO+tIDYsif36Roh2WoRBz8R Eml7JpzaIohXvZtbrjMLxtlwKezx6BulVzAZ60G1QGridBvXSvFkRdwB378m5hs7fEQa YMtP9s9i9dIMCnsXtUm4Z/Oyc+wVrTZ8fpg95GPOtqkjub1xl473EXXOUO1v3VQpGHPd Gth5ei7NyIVJJ8Ny1bb440Eo60K75o9j14HioCg1d8cvcLSmZxFaVBQfa30N2Sz18EfK iT6LLsk+WJv1kT0yuotpGVFsgo5tRDezq0MmxFDniMv5QQEcKEFgEIrjIETumkfxZfBd iTPQ== X-Gm-Message-State: APjAAAUdYQR5foe5FvA1LBvaorniqwzjgSOeYTau0FfHrjJlk3To2E8u 21WuXFjkCoC387wycfA9HdgOZx1n X-Received: by 2002:a63:7a06:: with SMTP id v6mr84513475pgc.115.1564011904078; Wed, 24 Jul 2019 16:45:04 -0700 (PDT) Date: Wed, 24 Jul 2019 16:44:57 -0700 Message-Id: <20190724234500.253358-1-nums@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.22.0.657.g960e92d24f-goog Subject: [PATCH 0/3] Perf uninitialized value fixes From: Numfor Mbiziwo-Tiapo To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, songliubraving@fb.com, mbd@fb.com Cc: linux-kernel@vger.kernel.org, irogers@google.com, eranian@google.com, Numfor Mbiziwo-Tiapo Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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