Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:
Since W is in the unreachable set, we should not be executing its callback. Would the attached rough patch (gc_disable_wr_callback.txt) be a possible fix? When we find W inside handle_weakrefs(), we mark it as trash and will not execute the callback. This is similar to Pablo's bpo-38009 but I think attacks the problem in a better way. Having func_clear() being run is only one possible bad outcome of executing the callback. We want to avoid executing *any* user level Python code if the weakref has access to objects found by the GC and which have tp_clear called on them. ---------- Added file: https://bugs.python.org/file48630/gc_disable_wr_callback.txt _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38006> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com