[talk] Is getaddrinfo thread-safe on OS X?

James E Keenan jkeen at verizon.net
Sat Jan 2 21:59:10 EST 2016


On 01/02/2016 09:43 PM, A. Jesse Jiryu Davis wrote:
> Hi NYC*BUG folk. I'm a MongoDB coder and CPython contributor in NYC. I hope
> you can help me answer a Darwin / Mac OS X question.
>
> There's rampant speculation regarding whether Mac OS X's implementation of
> getaddrinfo is thread-safe. Uncertainty is so widespread that even the
> Python standard library locks around calls to getaddrinfo to avoid a
> possible bug:
>
> https://hg.python.org/cpython/file/d2b8354e87f5/Modules/socketmodule.c#l185
>
> There was a FreeBSD bug "getaddrinfo not thread-safe" resolved back in
> 2006, but I don't know if Darwin and / or Mac OS X got the same bugfix, or
> a different bugfix, or no bugfix. I have a deeper ignorance, too, about the
> relationship between the FreeBSD, Darwin, and Mac OS X implementations of
> libc functions like getaddrinfo. I don't know where to look for OS X's
> implementation of getaddrinfo either (I can't find it on
> opensource.apple.com).
>
> Is there a Darwin or OS X expert on the list who could help me investigate?
>
> Links:
>
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=60478
> http://www.manpagez.com/man/3/getaddrinfo/osx-10.4.9.php
> http://www.manpagez.com/man/3/getaddrinfo/osx-10.5.php
>
>

I don't know if these address the thread-safety question, but they seem 
like starting points:

https://duckduckgo.com/?q=getaddrinfo+Darwin&t=canonical

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/getaddrinfo.3.html

jimk




More information about the talk mailing list