Message256838
https://emptysqua.re/blog/getaddrinfo-deadlock/ claims that getaddrinfo may deadlock when using threads and fork on (amongst others) OSX due to using a global lock.
That lock is used when getaddrinfo is believed to be not thread safe, see the relevant code below (from the blog post):
/* On systems on which getaddrinfo() is believed to not be thread-safe,
(this includes the getaddrinfo emulation) protect access with a lock. */
#if defined(WITH_THREAD) && (defined(__APPLE__) || \
(defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \
defined(__OpenBSD__) || defined(__NetBSD__) || \
defined(__VMS) || !defined(HAVE_GETADDRINFO))
#define USE_GETADDRINFO_LOCK
#endif
I think it is worthwhile to investigate whether or not getaddrinfo on OSX is really not thread safe.
Some source code for OSX can be found at the link below, I haven't checked yet which OSX release this corresponds to:
http://www.opensource.apple.com/source/Libinfo/Libinfo-278/lookup.subproj/getaddrinfo.c |
|
Date |
User |
Action |
Args |
2015-12-22 12:57:11 | ronaldoussoren | set | recipients:
+ ronaldoussoren, ned.deily |
2015-12-22 12:57:10 | ronaldoussoren | set | messageid: <1450789030.99.0.515103781608.issue25924@psf.upfronthosting.co.za> |
2015-12-22 12:57:10 | ronaldoussoren | link | issue25924 messages |
2015-12-22 12:57:09 | ronaldoussoren | create | |
|