From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Numfor Mbiziwo-Tiapo <nums@google.com>
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 1/2] Fix mmap-thread-lookup.c unitialized memory usage
Date: Wed, 3 Jul 2019 00:09:26 -0300 [thread overview]
Message-ID: <20190703030926.GN15462@kernel.org> (raw)
In-Reply-To: <20190702173716.181223-1-nums@google.com>
Em Tue, Jul 02, 2019 at 10:37:15AM -0700, Numfor Mbiziwo-Tiapo escreveu:
> Running the perf test command after building perf with a memory
> sanitizer causes a warning that says:
> WARNING: MemorySanitizer: use-of-uninitialized-value... in mmap-thread-lookup.c
> Initializing the go variable to 0 fixes this change.
>
> Signed-off-by: Numfor Mbiziwo-Tiapo <nums@google.com>
> ---
> tools/perf/tests/mmap-thread-lookup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
> index 5ede9b561d32..b1abf4752f35 100644
> --- a/tools/perf/tests/mmap-thread-lookup.c
> +++ b/tools/perf/tests/mmap-thread-lookup.c
> @@ -52,7 +52,7 @@ static void *thread_fn(void *arg)
> {
> struct thread_data *td = arg;
> ssize_t ret;
> - int go;
> + int go = 0;
>
> if (thread_init(td))
> return NULL;
The test needs to write something to a file, whatever, so this doesn't
fix anything, just silences the compiler warning, which is a good thing.
I'll apply and adjust the cset commit log.
Thanks,
- Arnaldo
next prev parent reply other threads:[~2019-07-03 3:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 17:37 [PATCH 1/2] Fix mmap-thread-lookup.c unitialized memory usage Numfor Mbiziwo-Tiapo
2019-07-02 17:37 ` [PATCH 2/2] Fix perf-hooks test Numfor Mbiziwo-Tiapo
2019-07-05 16:40 ` Arnaldo Carvalho de Melo
2019-07-03 3:09 ` Arnaldo Carvalho de Melo [this message]
2019-07-13 10:52 ` [tip:perf/urgent] perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning tip-bot for Numfor Mbiziwo-Tiapo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190703030926.GN15462@kernel.org \
--to=arnaldo.melo@gmail.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbd@fb.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=nums@google.com \
--cc=peterz@infradead.org \
--cc=songliubraving@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).