This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients Guido.van.Rossum, gvanrossum, inglesp, pitrou, tim.golden, tim.peters, vstinner
Date 2014-05-06.01:36:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399340179.57.0.591618640093.issue21435@psf.upfronthosting.co.za>
In-reply-to
Content
Thought question:  suppose finalize_garbage() is called with a collectable list all of whose members are in fact going to be destroyed?

I don't see how the loop iteration logic could reliably work then.  For concreteness, suppose there's only object - A - in the list.  It's a circular list so gc starts as A.  A is finalized, we see it's refcount is 1, `gc = gc->gc.gc_prev` sets gc to A again, and A is destroyed by the Py_DECREF.  We go back to the top of the loop, and then `gc = gc->gc.gc_next` reads up trash (free'd) memory.

Or so it seems to me ;-)
History
Date User Action Args
2014-05-06 01:36:19tim.peterssetrecipients: + tim.peters, gvanrossum, pitrou, vstinner, tim.golden, inglesp, Guido.van.Rossum
2014-05-06 01:36:19tim.peterssetmessageid: <1399340179.57.0.591618640093.issue21435@psf.upfronthosting.co.za>
2014-05-06 01:36:19tim.peterslinkissue21435 messages
2014-05-06 01:36:18tim.peterscreate