Message216121
I just found that python consider linux implementation of getaddrinfo thread safe :
./python2.6-2.6.8/Modules/socketmodule.c:180
/* 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
Badly, it's wrong on my version of linux, and maybe others : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=722075
So for me, looping in three threads on getaddrinfo leads me to a rapid deadlock, while reading on a NETLINK socket, after another thread wrote a DNS query on it and trying to get a response on it.
It may only be reproductible when your getaddrinfo use a NETLINK to get informations about your interfaces before doing the DNS query. |
|
Date |
User |
Action |
Args |
2014-04-14 17:21:43 | Julien.Palard | set | recipients:
+ Julien.Palard |
2014-04-14 17:21:43 | Julien.Palard | set | messageid: <1397496103.55.0.0681287877532.issue21216@psf.upfronthosting.co.za> |
2014-04-14 17:21:43 | Julien.Palard | link | issue21216 messages |
2014-04-14 17:21:43 | Julien.Palard | create | |
|