summaryrefslogtreecommitdiffstats
path: root/Python/getcompiler.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-07-28 20:39:08 (GMT)
committerGitHub <noreply@github.com>2023-07-28 20:39:08 (GMT)
commit8ba4df91ae60833723d8d3b9afeb2b642f7176d5 (patch)
treec9e659951582121e0f08d97ca075825c58ab65a5 /Python/getcompiler.c
parent55ed85e49c16b1dc5470a8a893869261f6356c99 (diff)
downloadcpython-8ba4df91ae60833723d8d3b9afeb2b642f7176d5.zip
cpython-8ba4df91ae60833723d8d3b9afeb2b642f7176d5.tar.gz
cpython-8ba4df91ae60833723d8d3b9afeb2b642f7176d5.tar.bz2
gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache (gh-106974)
This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the combination of the "detached" thread state we were using and the "last holder" logic we use for the GIL. It turns out it's tricky to use the same thread state for different threads. Who could have guessed? We solve the problem by eliminating the one object we were still sharing between interpreters. We replace it with a low-level hashtable, using the "raw" allocator to avoid tying it to the main interpreter. We also remove the accommodations for "detached" thread states, which were a dubious idea to start with.
Diffstat (limited to 'Python/getcompiler.c')
0 files changed, 0 insertions, 0 deletions