Message93099
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:00 | pjenvey | set | recipients:
+ pjenvey, amaury.forgeotdarc |
2009-09-25 03:28:00 | pjenvey | set | messageid: <1253849280.29.0.910949880833.issue6990@psf.upfronthosting.co.za> |
2009-09-25 03:27:58 | pjenvey | link | issue6990 messages |
2009-09-25 03:27:57 | pjenvey | create | |
|