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 pjenvey
Recipients amaury.forgeotdarc, pjenvey
Date 2009-09-25.03:27:56
SpamBayes Score 0.00048549808
Marked as misclassified No
Message-id <1253849280.29.0.910949880833.issue6990@psf.upfronthosting.co.za>
In-reply-to
Content
When threading.local subclasses are cleared during a reference cycle the 
local's internal key is nulled before the local is deallocated. That's a 
problem because local only deletes its state (ldicts) from threads 
during deallocation, and doesn't do so at all when its key is null.

So leaving ldicts around is one thing, but what's worse is they can be 
recycled by new local objects later -- since ldicts are mapped to 
threadstates by said key, and said key is based on the local's pointer. 
If a new local is malloced at the old one's address it can end up with 
the original's ldicts (depending on which thread it's allocated from).

Attached is a test against trunk showing this. Should we delete the 
ldicts during clear, recreate the key during dealloc, or something else?
History
Date User Action Args
2009-09-25 03:28:00pjenveysetrecipients: + pjenvey, amaury.forgeotdarc
2009-09-25 03:28:00pjenveysetmessageid: <1253849280.29.0.910949880833.issue6990@psf.upfronthosting.co.za>
2009-09-25 03:27:58pjenveylinkissue6990 messages
2009-09-25 03:27:57pjenveycreate