[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190703030926.GN15462@kernel.org>
Date: Wed, 3 Jul 2019 00:09:26 -0300
From: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To: Numfor Mbiziwo-Tiapo <nums@...gle.com>
Cc: peterz@...radead.org, mingo@...hat.com,
alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
namhyung@...nel.org, songliubraving@...com, mbd@...com,
linux-kernel@...r.kernel.org, irogers@...gle.com,
eranian@...gle.com
Subject: Re: [PATCH 1/2] Fix mmap-thread-lookup.c unitialized memory usage
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@...gle.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
Powered by blists - more mailing lists