Author vstinner
Recipients benjamin.peterson, gregory.p.smith, izbyshev, miss-islington, pitrou, serhiy.storchaka, siddhesh, skrah, steve.dower, vstinner
Date 2018-11-30.16:54:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543596896.57.0.788709270274.issue33015@psf.upfronthosting.co.za>
In-reply-to
Content
Oh... test_threaded_import started to crash on Python 2.7:

$ ./python -m test  -F -v test_threaded_import
(...)
0:00:00 load avg: 1.06 [  3] test_threaded_import
Trying 20 threads ... OK.
Trying 50 threads ... OK.
Trying 20 threads ... OK.
Segmentation fault (core dumped)

The problem is that PyMem_Malloc() is not thread safe when Python is compiled in debug mode! In release mode, it's safe because PyMem_Malloc() is a thin wrapper to malloc(). But in debug mode, PyMem_Malloc() uses the debug hooks and... pymalloc allocator which is not thread-safe!
History
Date User Action Args
2018-11-30 16:54:56vstinnersetrecipients: + vstinner, gregory.p.smith, pitrou, benjamin.peterson, skrah, serhiy.storchaka, steve.dower, siddhesh, izbyshev, miss-islington
2018-11-30 16:54:56vstinnersetmessageid: <1543596896.57.0.788709270274.issue33015@psf.upfronthosting.co.za>
2018-11-30 16:54:56vstinnerlinkissue33015 messages
2018-11-30 16:54:56vstinnercreate