Syscall param sendmsg(mmsg[0].msg_hdr) points to uninitialised byte(s)

Bug #1096826 reported by Removed by request
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I'm using Ubuntu 13.04 dev with libc6-dev 2.16-0ubuntu8. The following code causes valgrind to show a warning:

#include <netdb.h>

int main()
{
 struct addrinfo *address, type;

 type.ai_family = AF_UNSPEC;
 type.ai_flags = 0;
 type.ai_protocol = 0;
 type.ai_socktype = 0;
 getaddrinfo("www.google.de", "80", &type, &address);
 freeaddrinfo(address);
 return 0;
}

The code was compiled with "gcc -o test test.c" and "valgrind ./test" shows:

==46343== Memcheck, a memory error detector
==46343== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==46343== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==46343== Command: ./test
==46343==
==46343== Syscall param sendmsg(mmsg[0].msg_hdr) points to uninitialised byte(s)
==46343== at 0x4F2CEA9: sendmmsg (sendmmsg.c:32)
==46343== by 0x5A158ED: __libc_res_nsend (res_send.c:1140)
==46343== by 0x5A12D3B: __libc_res_nquery (res_query.c:226)
==46343== by 0x5A136D8: __libc_res_nsearch (res_query.c:582)
==46343== by 0x5805B37: _nss_dns_gethostbyname4_r (dns-host.c:313)
==46343== by 0x4EFDEEA: gaih_inet (getaddrinfo.c:842)
==46343== by 0x4F01E43: getaddrinfo (getaddrinfo.c:2417)
==46343== by 0x4005CC: main (in /home/sworddragon/data/test)
==46343== Address 0x7feffe330 is on thread 1's stack
==46343==
==46343==
==46343== HEAP SUMMARY:
==46343== in use at exit: 0 bytes in 0 blocks
==46343== total heap usage: 63 allocs, 63 frees, 10,182 bytes allocated
==46343==
==46343== All heap blocks were freed -- no leaks are possible
==46343==
==46343== For counts of detected and suppressed errors, rerun with: -v
==46343== Use --track-origins=yes to see where uninitialised values come from
==46343== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 2 from 2)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in glibc (Ubuntu):
status: New → Confirmed
Revision history for this message
Andy Sayler (andy.sayler) wrote :

I'm seeing this same valgrind error when using libcurl4-openssl-dev, ostensibly because libcurl is making similar calls to the ones suggested by the OP.

The "issue" seems to be realted to a glibc change to the way some sendmsg() variables are handled: http://sourceware.org/bugzilla/show_bug.cgi?id=14687.

The solution may be to update the valgrind suppression files to include this "error" as opposed to "fixing" glibc.

Revision history for this message
Removed by request (removed3425744) wrote :

I'm using Ubuntu 14.10 dev with libc6-dev 2.19-0ubuntu6 and valgrind 1:3.10~20140411-0ubuntu1 and the error message doesn't appear anymore.

Changed in glibc (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.