Author pjenvey
Recipients amaury.forgeotdarc, pjenvey
Date 2009-09-25.03:27:56
SpamBayes Score 0.000485498
Marked as misclassified No
Message-id <>
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?
Date User Action Args
2009-09-25 03:28:00pjenveysetrecipients: + pjenvey, amaury.forgeotdarc
2009-09-25 03:28:00pjenveysetmessageid: <>
2009-09-25 03:27:58pjenveylinkissue6990 messages
2009-09-25 03:27:57pjenveycreate