lkml.org 
[lkml]   [2019]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@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

\
 
 \ /
  Last update: 2019-07-03 05:10    [W:0.065 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site