Marc-Andre Lemburg added the comment: After a closer look at recent checkins, I found this checking for the trash can mechanism: 5a2ef447b80d (ticket #13992).
This appears to be the cause: 1.20 #define Py_TRASHCAN_SAFE_BEGIN(op) \ 1.21 - if (_PyTrash_delete_nesting < PyTrash_UNWIND_LEVEL) { \ 1.22 - ++_PyTrash_delete_nesting; 1.23 - /* The body of the deallocator is here. */ 1.24 + do { \ 1.25 + PyThreadState *_tstate = PyThreadState_GET(); \ 1.26 + if (_tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \ 1.27 + ++_tstate->trash_delete_nesting; 1.28 + /* The body of the deallocator is here. */ At the time the Py_AtExit functions are called, the thread state is NULL, so the if (_tstate->...) segfaults. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17703> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com