This is the mail archive of the
mailing list for the glibc project.
Re: getaddrinfo thread-safe?
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Joshua Rogers <megamansec at gmail dot com>, glibc <libc-help at sourceware dot org>
- Date: Mon, 23 Mar 2015 11:27:43 -0400
- Subject: Re: getaddrinfo thread-safe?
- Authentication-results: sourceware.org; auth=none
- References: <5510006C dot 1020908 at gmail dot com>
On 03/23/2015 08:00 AM, Joshua Rogers wrote:
> According to http://tools.ietf.org/html/rfc3493#section-6.1: getaddrinfo
> needs to be thread-safe:
> " Functions getaddrinfo() and freeaddrinfo() must be thread-safe."
> However, it doesn't seem to be.
It should be.
> With the very simple code: http://codepad.org/hRxP9E1J
> valgrind (valgrind --tool=drd --read-var-info=yes ./a.out) picks up a
> lot of conflicting reads/writes. -- http://pastebin.com/ebQS8MMc
> Is this a known bug?
We do have:
"getaddrinfo is not thread safe against concurrent setenv"
Please debug a bit further and see if you can suss out what's actually
going on and which writes are conflicting. Your sources don't appear to
line up with master, so I would suggest a simple test case using:
-Wl,--dynamic-linker and -Wl,-rpath.