getaddrinfo thread-safe?
Carlos O'Donell
carlos@redhat.com
Mon Mar 23 15:27:00 GMT 2015
On 03/23/2015 08:00 AM, Joshua Rogers wrote:
> Hi,
>
> 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?
No.
We do have:
"getaddrinfo is not thread safe against concurrent setenv"
https://sourceware.org/bugzilla/show_bug.cgi?id=13271
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.
Cheers,
Carlos.
More information about the Libc-help
mailing list