[New-bugs-announce] [issue41185] lib2to3 generation of pickle files is racy

Marco Barisione report at bugs.python.org
Wed Jul 1 12:05:44 EDT 2020


New submission from Marco Barisione <marco at barisione.org>:

The generation of pickle files in load_grammar in lib2to3/pgen2/driver.py is racy as other processes may end up reading a half-written pickle file.

This is reproducible with the command line tool, but it's easier to reproduce by importing lib2to3. You just need different processes importing lib2to3 at the same time to make this happen, see the attached reproducer.

I tried with Python 3.9 for completeness and, while it happens there as well, it seems to be less frequent ony my computer than when using Python 3.6 (2% failure rate instead of 50% failure rate).

----------
components: 2to3 (2.x to 3.x conversion tool)
files: pool.py
messages: 372760
nosy: barisione
priority: normal
severity: normal
status: open
title: lib2to3 generation of pickle files is racy
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49284/pool.py

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


More information about the New-bugs-announce mailing list