[issue34572] C unpickling bypasses import thread safety

Valentyn Tymofieiev report at bugs.python.org
Thu Nov 21 14:24:33 EST 2019


Valentyn Tymofieiev <valentyn at google.com> added the comment:

While investigating[1], I observe that certain unpickling operations, for example, Unpickler.find_class, remain not thread-safe in Python 3.7.5 and earlier versions that I tried. I have not tried 3.8, but cannot reproduce this error on Python 2. 

For example, attached find_class_deadlock.py which consistently fails with a deadlock on Python 3.7.5.

I opened https://bugs.python.org/issue38884, which may be causing these errors, since the failure mode is similar, and in at least some codepaths, find_class seems to be calling __import__ [2].

[1] https://issues.apache.org/jira/browse/BEAM-8651
[2] https://github.com/python/cpython/blob/4ffc569b47bef9f95e443f3c56f7e7e32cb440c0/Lib/pickle.py#L1426.

----------
nosy: +Valentyn Tymofieiev

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34572>
_______________________________________


More information about the Python-bugs-list mailing list