Repository navigation
[subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression) #90228
Description
Activity
Seems as though cpython is broken when working with subinterpreters. The problematic change could be (d0d2965) affecting import.c.[1] Reverting this commit and rebuilding python fixes the issues on my system with some scripts that import sqlite, for example, the Kodi plugin YouTube[2] and the IMDB Trailers plugin. Others have reported similar breakage with other python code[3].
Example output when the bug manifests:
ERROR <general>: Traceback (most recent call last): ERROR <general>: File "/usr/lib/python3.10/sqlite3/dbapi2.py", line 83, in register_adapters_and_converters ERROR <general>: ERROR <general>: register_converter("timestamp", convert_timestamp) ERROR <general>: ERROR <general>: KeyError ERROR <general>: : ERROR <general>: 'timepart_full' ERROR <general>: ERROR <general>: Exception ignored deletion of interned string failed ERROR <general>: :References:
- added3.10 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
on Dec 14, 2021 - added3.9 (EOL)end of lifeend of life3.11only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Dec 14, 2021 58 remaining items
So far, only released Python v3.11.0a4 include my "_PyGC_Fini() untracks objects" fix. The 3.9 and 3.10 branch include my fix, but there is no release including it yet.
Scheduled releases:
- Python 3.9.13: Monday, 2022-05-16: https://peps.python.org/pep-0596/
- Python 3.10.5: Monday, 2022-06-06: https://peps.python.org/pep-0619/
I managed to reproduce the bug.py crash with main branch up to commit 12c0012 .
Oh really? This version include my fix. I cannot reproduce it on the current main branch (commit ea2f5bc) nor at commit 12c0012. Which commands did you type to build Python and reproduce the crash? What is your OS and C compiler?
Reacted by Peter FernThe original issue is fixed. Please open a new issue for sqlite3_crash.py.
I created #92036 for sqlite3_crash.py bug.
Should this be closed then?
I kept this issue open for this reason:
It would be nice to add some tests.
Reacted by Erlend E. Aasland and Eric SnowMy notes about this bug: https://twitter.com/VictorStinner/status/1481783100191428611
Reacted by Erlend E. Aasland and Jose Riha- addedtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dumpand removedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Jul 3, 2026 _srewas converted to multi-phase init with per-interpreter state, which removed the root cause. Importing_srein 160 subinterpreters across 8 parallel threads runs cleanly on a debug build of main. Closing as fixed.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
nproc --allNote: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: