BornAgain embedded Fabio test fails under some Python versions
The test Unit.PyBinding.Embedded.BornAgainPyFabioTest
fails with segfault under Python 3.11.x, with x >= 2
, under Debian/Linux.
The test passes for Python 3.10, 3.12 and 3.13.
GDB bakctrace indicates the segfault cause at
_PyObject_IS_GC (obj=0x7f04d1680860) at ./Include/object.h:772
...
PyInterpreter::Fabio::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
which implies that Python garbage collector has failed, most likely due to some reference-counting issue ("double free"); that is, an incorrect memory management of Python objects via the Python C-API.
Note that Python 3.11 has introduced some significant changes to its memory allocator and garbage collector, and is more strict regrading the reference counting.