<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:DengXian;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="ZH-CN" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US"># HG changeset patch</span><span lang="EN-US" style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"># User Johnny Wang <johnnywang1991@msn.com><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"># Date 1618472983 -28800<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"># Thu Apr 15 15:49:43 2021 +0800<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"># Node ID a5903fe55622e839906e9544c1a08a66c1e0cf91<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"># Parent b56c45e3bd5029f98e1e847eebad75430e2cca27<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Initialize 'ch' with 'ngx_memzero' to prevent the use of uninitialized bytes.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I found the following error when running nginx with valgrind:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== at 0x5047C50: __sendmsg_nocancel (in /lib64/libpthread-2.17.so)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== by 0x44A6F8: ngx_write_channel (ngx_channel.c:79)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== by 0x44C19A: ngx_pass_open_channel (ngx_process_cycle.c:481)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== by 0x44C21A: ngx_start_worker_processes (ngx_process_cycle.c:385)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== by 0x44E0BA: ngx_master_process_cycle (ngx_process_cycle.c:241)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== by 0x424719: main (nginx.c:386)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== Address 0x1ffefffabc is on thread 1's stack<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539== in frame #2, created by ngx_pass_open_channel (ngx_process_cycle.c:455)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">==31539==<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><insert_a_suppression_name_here><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Memcheck:Param<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">sendmsg(msg.msg_iov[0])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">fun:__sendmsg_nocancel<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">fun:ngx_write_channel<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">fun:ngx_pass_open_channel<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">fun:ngx_start_worker_processes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">fun:ngx_master_process_cycle<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">fun:main<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">diff -r b56c45e3bd50 -r a5903fe55622 src/os/unix/ngx_process_cycle.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">--- a/src/os/unix/ngx_process_cycle.c Tue Apr 13 18:13:59 2021 +0300<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">+++ b/src/os/unix/ngx_process_cycle.c Thu Apr 15 15:49:43 2021 +0800<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">@@ -398,6 +398,8 @@<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ngx_int_t i;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ngx_channel_t ch;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">+ ngx_memzero(&ch, sizeof(ngx_channel_t));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">+<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ch.command = NGX_CMD_OPEN_CHANNEL;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ch.pid = ngx_processes[ngx_process_slot].pid;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ch.slot = ngx_process_slot;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>