Friday, February 22, 2013

You can be right, or you decide to save everyone else a bunch of time...

This is one of my favorite valgrind finds at the moment (well, last few months):
|| ==881== Syscall param sendmsg(mmsg[0].msg_hdr) points to uninitialised byte(s)
|| ==881==    at 0x386BAF3D6B: sendmmsg (sendmmsg.c:36)
|| ==881==    by 0x386DE0B4D6: __libc_res_nsend (res_send.c:1132)
|| ==881==    by 0x386DE08BDF: __libc_res_nquery (res_query.c:226)
|| ==881==    by 0x386DE097B9: __libc_res_nsearch (res_query.c:582)
|| ==881==    by 0x5E8CAC7: _nss_dns_gethostbyname4_r (dns-host.c:309)
|| ==881==    by 0x386BAD9AF1: gaih_inet (getaddrinfo.c:845)
|| ==881==    by 0x386BADD750: getaddrinfo (getaddrinfo.c:2359)

If you really want to be right, and not cost a lot of other people time when you know you are right and valgrind is wrong. You could leave a snarky comment in the code where you create a fix to silence the valgrind error.

Or you could decide to not fix the warning, and cost a lot of other developers their time as they trip over you academically correct code which spews errors when run through valgrind.


No comments:

Post a Comment