New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>: There are following bugs in the garbage collector.
* If the garbage collector fails to add an object with __del__ or referenced by an object with __del__ to gc.garbage (in handle_legacy_finalizers()), it leaks it and other not added objects with __del__ and referenced by them. They become no longer accessible by the garbage collector. * PyGC_Collect() is not documented, but it is a public C API. And it can be called by user with an exception set. PyGC_Collect() then can either crash or just silent the exception. It is safer to safe possible exception and restore it after collecting. * A pointer to released member can be used (compared with NULL) in invoke_gc_callback(). This is an undefined behavior. ---------- components: Interpreter Core messages: 317431 nosy: pitrou, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Fix and improve errors handling in the garbage collector type: behavior versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33622> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com