Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "sitsofe@gmail.com" <sitsofe@gmail.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Cc: "fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: valgrind spews
Date: Thu, 22 Mar 2018 17:27:59 +0000	[thread overview]
Message-ID: <1521739678.2637.16.camel@wdc.com> (raw)
In-Reply-To: <3e6568da-0dfe-7d4a-138d-f04e43a3dd7b@kernel.dk>

On Thu, 2018-03-22 at 11:23 -0600, Jens Axboe wrote:
> On 3/22/18 11:12 AM, Bart Van Assche wrote:
> > Where is the sk_out structure allocated? Can Valgrind know whether or not
> > that structure has been initialized?
> 
> In server.c:accept_loop() and that structure is memset at alloc
> time as it's coming out of smalloc().

Would you be OK with changing that smalloc() call into scalloc() such that
Valgrind knows that that structure is initialized? On my laptop the following
is sufficient to suppress the complaints mentioned in my previous e-mail:

diff --git a/server.c b/server.c
index 15dc2c4b38ba..d3f69774165f 100644
--- a/server.c
+++ b/server.c
@@ -1359,7 +1359,7 @@ static int accept_loop(int listen_sk)
 
 		dprint(FD_NET, "server: connect from %s\n", from);
 
-		sk_out = smalloc(sizeof(*sk_out));
+		sk_out = scalloc(1, sizeof(*sk_out));
 		if (!sk_out) {
 			close(sk);
 			return -1;

Thanks,

Bart.


  reply	other threads:[~2018-03-22 17:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 16:14 valgrind spews Jens Axboe
2018-03-22 16:53 ` Sitsofe Wheeler
2018-03-22 17:01   ` Jens Axboe
2018-03-22 17:12     ` Bart Van Assche
2018-03-22 17:23       ` Jens Axboe
2018-03-22 17:27         ` Bart Van Assche [this message]
2018-03-22 17:29           ` Jens Axboe
2018-03-23 14:39             ` Sitsofe Wheeler
2018-03-23 14:49               ` Jens Axboe
2018-03-23 15:15                 ` Bart Van Assche
2018-03-23 21:43                   ` Sitsofe Wheeler
2018-03-23 21:49                     ` Bart Van Assche
2018-03-23 22:18                       ` Sitsofe Wheeler
2018-03-23 22:53                         ` Jens Axboe
2018-03-22 17:08 ` Bart Van Assche

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=1521739678.2637.16.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=sitsofe@gmail.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