id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 8290,"Python GIL not acquired before freeing shared_ptr, causes crash",team@…,Ralf W. Grosse-Kunstleve,"We're successfully using boost::python with Python on multiple threads that lock and release the GIL as appropriate, and correctly set the Python thread state, etc. One thing we don't have control over, however, is the freeing of shared_ptr objects which were created by boost::python. This may happen on a different thread than the previous Python execution and/or without the GIL being locked. To fix this, the following patch is required: {{{ --- builtin_converters.cpp 2011-06-07 06:15:33.000000000 +0200 +++ builtin_converters.cpp.fixed 2013-03-13 12:57:29.346638173 +0100 @@ -32,7 +32,9 @@ void shared_ptr_deleter::operator()(void const*) { + PyGILState_STATE gil = PyGILState_Ensure(); owner.reset(); + PyGILState_Release(gil); } namespace }}} This fix can be applied externally to boost::python, but requires a few header files that re-implement shared_ptr_to_python.hpp and shared_ptr_from_python.hpp.",Bugs,new,To Be Determined,python USE GITHUB,Boost 1.52.0,Problem,,,