[issue17703] Trash can mechanism segfault during interpreter finalization in Python 2.7.4

Marc-Andre Lemburg report at bugs.python.org
Fri Apr 12 17:41:58 CEST 2013


Marc-Andre Lemburg added the comment:

On 12.04.2013 17:32, Antoine Pitrou wrote:
> 
> Judging by the fact that the Py_AtExit funcs are called at the very end of Py_Finalize (after absolutely everything has been cleaned up), I think you shouldn't use any Python facilities at this point.

As mentioned earlier: this is the only way to cleanup extension modules
in Python 2.x and the trash can patch broke this.

> By the way, why do you try to clean up the dictionary at this point? Any non-trivial deallocation
code (e.g. __del__ method) will fail running.

The dictionaries just contain simple Python types that don't
have __del__ methods, so deallocation works fine and it prevents
memory leaks when embedding the Python interpreter and restarting
it several times.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17703>
_______________________________________


More information about the Python-bugs-list mailing list