New submission from Armin Rigo:
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
Reproduced on Python 2.7, 3.3, 3.5, 3.6-debug.
title: WeakValueDictionary next bug (with multithreading)
versions: Python 2.7, Python 3.3, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file45072/test.py
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list