<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello All,<div class=""><br class=""></div><div class="">TL;DR: valgrind always complains about "Syscall param write(buf) points to uninitialised byte(s)” for a LOT of MPI operations in petsc code, making debugging using valgrind fairly annoying since I have to sort through a ton of unrelated stuff. I have built valgrind from source, used apt install valgrind, apt install valgrind-mpi to no avail.</div><div class=""><br class=""></div><div class="">I am using valgrind from docker. Dockerfile is attached below as well. I have been unsuccessfully trying to resolve these local valgrind errors, but I am running out of ideas. Googling the issue has also not provided entirely applicable solutions. Here is an example of the error:</div><div class=""><br class=""></div><div class="">$ make -f gmakefile test VALGRIND=1</div><div class="">...</div><div class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== Syscall param write(buf) points to uninitialised byte(s)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== at 0x6F63317: write (write.c:26)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x9056AC9: MPIDI_CH3I_Sock_write (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x9059FCD: MPIDI_CH3_iStartMsg (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x903F298: MPIDI_CH3_EagerContigShortSend (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x9049479: MPID_Send (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x8FC9B2A: MPIC_Send (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x8F86F2E: MPIR_Bcast_intra_binomial (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x8EE204E: MPIR_Bcast_intra_auto (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x8EE21F4: MPIR_Bcast_impl (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x8F887FB: MPIR_Bcast_intra_smp (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x8EE206E: MPIR_Bcast_intra_auto (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x8EE21F4: MPIR_Bcast_impl (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x8EE2A6F: PMPI_Bcast (in /usr/local/lib/libmpi.so.12.1.8)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x4B377B8: PetscOptionsInsertFile (options.c:525)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x4B39291: PetscOptionsInsert (options.c:672)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x4B5B1EF: PetscInitialize (pinit.c:996)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== by 0x10A6BA: main (ex9.c:75)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== Address 0x1ffeffa944 is on thread 1's stack<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== in frame #3, created by MPIDI_CH3_EagerContigShortSend (???:)<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== Uninitialised value was created by a stack allocation<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>==54610== at 0x903F200: MPIDI_CH3_EagerContigShortSend (in /usr/local/lib/libmpi.so.12.1.8)<br class=""><br class=""></div><div class="">There are probably 20 such errors every single time, regardless of what code is being run. I have tried using apt install valgrind, apt install valgrind-mpi, and building valgrind from source:</div><div class=""><br class=""></div># VALGRIND <br class="">WORKDIR /<br class="">RUN git clone <a href="git://sourceware.org/git/valgrind.git" class="">git://sourceware.org/git/valgrind.git</a><br class="">WORKDIR /valgrind<br class="">RUN git pull<br class="">RUN ./autogen.sh<br class="">RUN ./configure --with-mpicc=/usr/local/bin/mpicc<br class="">RUN make -j 5<br class=""><div class="">RUN make install </div><div class=""><br class=""></div><div class="">None of the those approaches lead to these errors disappearing. Perhaps I am missing some funky MPI args?</div><div class=""><br class=""></div><div class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>Best regards,<br class=""><br class="">Jacob Faibussowitsch<br class="">(Jacob Fai - booss - oh - vitch)<br class="">Cell: (312) 694-3391</div></div>
</div><div class=""></div></div></body></html>