This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients emptysquare, ionelmc, ronaldoussoren, serhiy.storchaka, terry.reedy, vstinner, yselivanov
Date 2020-05-14.23:48:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589500082.85.0.0607168434433.issue25920@roundup.psfhosted.org>
In-reply-to
Content
> (I wrote some more details here: https://emptysqua.re/blog/getaddrinfo-deadlock/ )

On macOS, Python is only affected if "MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5". Is it still the case in 2020?

Copy/paste of socketmodule.c:

/* On systems on which getaddrinfo() is believed to not be thread-safe,
   (this includes the getaddrinfo emulation) protect access with a lock.

   getaddrinfo is thread-safe on Mac OS X 10.5 and later. Originally it was
   a mix of code including an unsafe implementation from an old BSD's
   libresolv. In 10.5 Apple reimplemented it as a safe IPC call to the
   mDNSResponder process. 10.5 is the first be UNIX '03 certified, which
   includes the requirement that getaddrinfo be thread-safe. See issue #25924.

   It's thread-safe in OpenBSD starting with 5.4, released Nov 2013:
   http://www.openbsd.org/plus54.html

   It's thread-safe in NetBSD starting with 4.0, released Dec 2007:

http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82&r2=1.83
 */
#if ((defined(__APPLE__) && \
        MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) || \
    (defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \
    (defined(__OpenBSD__) && OpenBSD+0 < 201311) || \
    (defined(__NetBSD__) && __NetBSD_Version__+0 < 400000000) || \
    !defined(HAVE_GETADDRINFO))
#define USE_GETADDRINFO_LOCK
#endif
History
Date User Action Args
2020-05-14 23:48:02vstinnersetrecipients: + vstinner, terry.reedy, ronaldoussoren, ionelmc, serhiy.storchaka, yselivanov, emptysquare
2020-05-14 23:48:02vstinnersetmessageid: <1589500082.85.0.0607168434433.issue25920@roundup.psfhosted.org>
2020-05-14 23:48:02vstinnerlinkissue25920 messages
2020-05-14 23:48:02vstinnercreate