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 Anne Archibald, Manjusaka, gilles-duboscq, vstinner
Date 2021-02-18.17:27:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613669262.04.0.536626160028.issue39853@roundup.psfhosted.org>
In-reply-to
Content
"Segmentation fault with (...) threads (...) getaddrinfo"

Aha, another victim on a getaddrinfo() implementation which is not thread safe.

See this code in Modules/socketmodule.c:

/* Lock to allow python interpreter to continue, but only allow one
   thread to be in gethostbyname or getaddrinfo */
#if defined(USE_GETHOSTBYNAME_LOCK)
static PyThread_type_lock netdb_lock;
#endif

Can you please check if your Python was built with HAVE_GETHOSTBYNAME_R?

$ python3
Python 3.9.1 (default, Jan 20 2021, 00:00:00) 
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
>>> import sysconfig; repr(sysconfig.get_config_var('HAVE_GETHOSTBYNAME_R'))
'1'


Modules/socketmodule.c is full of #ifdef involving macOS...
History
Date User Action Args
2021-02-18 17:27:42vstinnersetrecipients: + vstinner, Manjusaka, Anne Archibald, gilles-duboscq
2021-02-18 17:27:42vstinnersetmessageid: <1613669262.04.0.536626160028.issue39853@roundup.psfhosted.org>
2021-02-18 17:27:42vstinnerlinkissue39853 messages
2021-02-18 17:27:41vstinnercreate