[issue21216] getaddrinfo is wrongly considered thread safe on linux
Gregory P. Smith added the comment: The upstream Debian issue contains a fix for the bug in eglibc. Python should not attempt to work around this. Distros need to fix their libc if they shipped a broken one. -- components: +Extension Modules resolution: - not a bug stage: - resolved status: open - closed type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
STINNER Victor added the comment: @Julien.Palard: Ping? Without more information, I would suggest to close the issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
STINNER Victor added the comment: It may only be reproductible when your getaddrinfo use a NETLINK to get informations about your interfaces before doing the DNS query. What is your operation system? Name and version. What is your version of the C library? What is your Python version? Can you provide an example to reproduce the issue? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
STINNER Victor added the comment: test_getaddrinfo.c: C program to run getaddrinfo() concurrently in different threads, it comes from the Debian issue. I ran this program with 10 threads, I stopped it after between 3000 and 5000 tries (depending on the thread). I'm running Fedora 20: Linux kernel 3.13.9-200.fc20.x86_64 and glibc 2.18. -- Added file: http://bugs.python.org/file34907/test_getaddrinfo.c ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
STINNER Victor added the comment: Can you provide the C and Python backtrace of all threads of your program? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
New submission from Julien Palard: 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. -- messages: 216121 nosy: Julien.Palard priority: normal severity: normal status: open title: getaddrinfo is wrongly considered thread safe on linux ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
Changes by Gregory P. Smith g...@krypto.org: -- assignee: - gregory.p.smith nosy: +gregory.p.smith versions: +Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
Gregory P. Smith added the comment: Can you attach some python code that reproduces this for you? According to both of the references below it doesn't sound like this is supposed to be a problem. http://pubs.opengroup.org/onlinepubs/9699919799/functions/freeaddrinfo.html claims The freeaddrinfo() and getaddrinfo() functions shall be thread-safe. Linux man pages claim getaddrinfo() is reentrant. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com