<div dir="ltr">Hi.<div class="gmail_extra" style><br></div><div class="gmail_extra" style>2013/6/12 Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span><br>
> The memzero call is certainly only needed in case of fd != -1<br>> (i.e., to suppress valgrind warning).<br></div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>I see. How is that?</div><div class="gmail_extra">
<br></div><div class="gmail_extra"><div class="gmail_extra"># HG changeset patch</div><div class="gmail_extra"># User Tatsuhiko Kubo <<a href="mailto:cubicdaiya@gmail.com">cubicdaiya@gmail.com</a>></div><div class="gmail_extra">
# Date 1370965284 -32400</div><div class="gmail_extra"># Node ID 2bb2b7d3a263d97b148b706407caf16fd0f074eb</div><div class="gmail_extra"># Parent 725fb71ab1a60bd48b0afb8b001b5349f5054cb1</div><div class="gmail_extra">Valgrind: a complaint about uninitialized bytes</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Valgrind outputs the following message</div><div class="gmail_extra">when NGX_HAVE_MSGHDR_MSG_CONTROL is 1.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
==12605== Syscall param socketcall.sendmsg(msg.msg_control) points to</div><div class="gmail_extra">uninitialised byte(s)</div><div class="gmail_extra">==12605== at 0x4E37660: __sendmsg_nocancel (syscall-template.S:82)</div>
<div class="gmail_extra">==12605== by 0x41C9BF: ngx_write_channel (ngx_channel.c:77)</div><div class="gmail_extra">==12605== by 0x41E2DC: ngx_pass_open_channel (ngx_process_cycle.c:454)</div><div class="gmail_extra">
==12605== by 0x41E3B6: ngx_start_worker_processes</div><div class="gmail_extra">(ngx_process_cycle.c:371)</div><div class="gmail_extra">==12605== by 0x41F368: ngx_master_process_cycle (ngx_process_cycle.c:136)</div>
<div class="gmail_extra">==12605== by 0x404A19: main (nginx.c:412)</div><div class="gmail_extra">==12605== Address 0x7ff000614 is on thread 1's stack</div><div class="gmail_extra"><br></div><div class="gmail_extra">
diff -r 725fb71ab1a6 -r 2bb2b7d3a263 src/os/unix/ngx_channel.c</div><div class="gmail_extra">--- a/src/os/unix/ngx_channel.c<span class="" style="white-space:pre"> </span>Fri Jun 07 13:16:00 2013 -0700</div><div class="gmail_extra">
+++ b/src/os/unix/ngx_channel.c<span class="" style="white-space:pre"> </span>Wed Jun 12 00:41:24 2013 +0900</div><div class="gmail_extra">@@ -31,6 +31,7 @@</div><div class="gmail_extra"> msg.msg_controllen = 0;</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"> } else {</div><div class="gmail_extra">+ ngx_memzero(&cmsg, sizeof(cmsg));</div><div class="gmail_extra"> msg.msg_control = (caddr_t) &cmsg;</div>
<div class="gmail_extra"> msg.msg_controllen = sizeof(cmsg);</div><div><br></div></div><div class="gmail_extra"><br><div><br></div>-- <br>Tatsuhiko Kubo<br><br>E-Mail : <a href="mailto:cubicdaiya@gmail.com" target="_blank">cubicdaiya@gmail.com</a><br>
HP : <a href="http://cccis.jp/index_en.html" target="_blank">http://cccis.jp/index_en.html</a><br>Twitter : <a href="http://twitter.com/cubicdaiya" target="_blank">http://twitter.com/cubicdaiya</a>
</div><div class="gmail_extra"><br></div></div>