This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getaddrinfo thread-safe?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]