Message217961
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 ;-) |
|
Date |
User |
Action |
Args |
2014-05-06 01:36:19 | tim.peters | set | recipients:
+ tim.peters, gvanrossum, pitrou, vstinner, tim.golden, inglesp, Guido.van.Rossum |
2014-05-06 01:36:19 | tim.peters | set | messageid: <1399340179.57.0.591618640093.issue21435@psf.upfronthosting.co.za> |
2014-05-06 01:36:19 | tim.peters | link | issue21435 messages |
2014-05-06 01:36:18 | tim.peters | create | |
|