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 <>
"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 */
static PyThread_type_lock netdb_lock;

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'))

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