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 arigo
Recipients arigo
Date 2016-10-13.10:36:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476354989.22.0.575160455599.issue28427@psf.upfronthosting.co.za>
In-reply-to
Content
Follow-up on http://bugs.python.org/issue19542.

Another crash of using WeakValueDictionary() in a thread-local fashion inside a multi-threaded program.  I must admit I'm not exactly sure why this occurs, but it is definitely showing an issue: two threads independently create their own WeakValueDictionary() and try to set one item in it.  The problem I get is that the "assert 42 in d" sometimes fails, even though 42 was set in that WeakValueDictionary on the previous line and the value is still alive.  This only occurs if there is a cycle of references involving the value.  See attached file.

Reproduced on Python 2.7, 3.3, 3.5, 3.6-debug.
History
Date User Action Args
2016-10-13 10:36:29arigosetrecipients: + arigo
2016-10-13 10:36:29arigosetmessageid: <1476354989.22.0.575160455599.issue28427@psf.upfronthosting.co.za>
2016-10-13 10:36:29arigolinkissue28427 messages
2016-10-13 10:36:28arigocreate