Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH] helper_thread: Initialize all helper_data members before using it
@ 2018-03-10  0:46 Bart Van Assche
  2018-03-10  4:34 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2018-03-10  0:46 UTC (permalink / raw)
  To: Jens Axboe; +Cc: fio, Bart Van Assche

This patch avoids that Valgrind reports the following:

==10492== Thread 2:
==10492== Conditional jump or move depends on uninitialised value(s)
==10492==    at 0x480295: helper_thread_main (helper_thread.c:89)
==10492==    by 0x57B961A: start_thread (pthread_create.c:465)
==10492==    by 0x5CEC98E: clone (clone.S:95)

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
---
 helper_thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/helper_thread.c b/helper_thread.c
index 64e5a3c9d792..b05f8212a621 100644
--- a/helper_thread.c
+++ b/helper_thread.c
@@ -156,7 +156,7 @@ int helper_thread_create(struct fio_mutex *startup_mutex, struct sk_out *sk_out)
 	struct helper_data *hd;
 	int ret;
 
-	hd = smalloc(sizeof(*hd));
+	hd = scalloc(1, sizeof(*hd));
 
 	setup_disk_util();
 	steadystate_setup();
-- 
2.16.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] helper_thread: Initialize all helper_data members before using it
  2018-03-10  0:46 [PATCH] helper_thread: Initialize all helper_data members before using it Bart Van Assche
@ 2018-03-10  4:34 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2018-03-10  4:34 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: fio

On 3/9/18 5:46 PM, Bart Van Assche wrote:
> This patch avoids that Valgrind reports the following:
> 
> ==10492== Thread 2:
> ==10492== Conditional jump or move depends on uninitialised value(s)
> ==10492==    at 0x480295: helper_thread_main (helper_thread.c:89)
> ==10492==    by 0x57B961A: start_thread (pthread_create.c:465)
> ==10492==    by 0x5CEC98E: clone (clone.S:95)

Applied, thanks.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-10  4:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-10  0:46 [PATCH] helper_thread: Initialize all helper_data members before using it Bart Van Assche
2018-03-10  4:34 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox