Repository navigation
[subinterpreters] Global C variables are a problem #81057
Copy link
Copy link
Closed
Labels
3.8 (EOL)end of lifeend of lifetopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Note: 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:
assignee = 'https://github.com/ericsnowcurrently'
closed_at = None
created_at = <Date 2019-05-10.19:01:42.087>
labels = ['expert-subinterpreters', 'type-bug', '3.8']
title = '[subinterpreters] Global C variables are a problem'
updated_at = <Date 2022-02-10.23:14:23.025>
user = 'https://github.com/ericsnowcurrently'bugs.python.org fields:
activity = <Date 2022-02-10.23:14:23.025>
actor = 'eric.snow'
assignee = 'eric.snow'
closed = False
closed_date = None
closer = None
components = ['Subinterpreters']
creation = <Date 2019-05-10.19:01:42.087>
creator = 'eric.snow'
dependencies = []
files = []
hgrepos = []
issue_num = 36876
keywords = ['patch']
message_count = 22.0
messages = ['342119', '342125', '352013', '352032', '352063', '352085', '352208', '354928', '356181', '357351', '357352', '357353', '368910', '379390', '379999', '381511', '383698', '383778', '393785', '412886', '412957', '413029']
nosy_count = 8.0
nosy_names = ['vinay.sajip', 'vstinner', 'christian.heimes', 'phsilva', 'eric.snow', 'maciej.szulik', 'pablogsal', 'Dennis Sweeney']
pr_nums = ['13372', '13531', '15760', '15877', '16017', '16058', '16328', '16841', '22841', '23045', '23431', '23918', '23929', '31225', '31239', '31264']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue36876'
versions = ['Python 3.8']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.8 (EOL)end of lifeend of lifetopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Activity
ericsnowcurrently commentedon May 10, 2019
We still have a bunch of "global" C variables (static globals, static locals, maybe thread-local storage) in our code-base that break the isolation between interpreters. I added Tools/c-globals/check-c-globals.py a while back to help identify such variables, however more have crept in. I also did not take static locals or thread-locals into account.
To address the above, we should do the following:
Separately, we should move fields out of _PyRuntimeState into PyInterpreterState wherever possible. That can also be done at step 2 if it's not too much work.
ericsnowcurrently commentedon May 10, 2019
Also, Tools/c-globals/ignored-globals.txt is a bit out of date (some vars have been removed, renamed, or moved to another file). That should get cleaned up. It might also make sense to update check-c-globals.py to verify that all variables in ignored-globals.txt actually exist.
ericsnowcurrently commentedon Sep 11, 2019
New changeset ee536b2 by Eric Snow in branch 'master':
bpo-36876: Add a tool that identifies unsupported global C variables. (bpo-15877)
ee536b2
db3l commentedon Sep 11, 2019
The new test_check_c_globals.ActualChecks test is failing with an "unexpected success" on the bolen-ubuntu buildbot (under Ubuntu 18.04.3). I can reproduce the failure in a manually built tree.
ericsnowcurrently commentedon Sep 12, 2019
@db3l, I'll take a look right away.
ericsnowcurrently commentedon Sep 12, 2019
New changeset 64535fc by Eric Snow in branch 'master':
bpo-36876: Skip test_check_c_globals for now. (gh-16017)
64535fc
ericsnowcurrently commentedon Sep 12, 2019
New changeset 088b63e by Eric Snow in branch 'master':
bpo-36876: Fix the globals checker tool. (gh-16058)
088b63e
ericsnowcurrently commentedon Oct 19, 2019
New changeset e4c431e by Eric Snow in branch 'master':
bpo-36876: Re-organize the c-analyzer tool code. (gh-16841)
e4c431e
vsajip commentedon Nov 7, 2019
New changeset 9def81a by Vinay Sajip in branch 'master':
bpo-36876: Moved Parser/listnode.c statics to interpreter state. (GH-16328)
9def81a
ericsnowcurrently commentedon Nov 23, 2019
Thanks, Vinay!
ericsnowcurrently commentedon Nov 23, 2019
FYI, others have been tackling this in separate issues (e.g. Victor, anyone relative to PEP-384).
45 remaining items
gh-81057: Move faulthandler Globals to _PyRuntimeState (gh-100152)
gh-81057: Move Signal-Related Globals to _PyRuntimeState (gh-100085)
gh-81057: Move _Py_RefTotal to the "Ignored Globals" List (gh-100203)
Merge branch 'main' into typedocs
gh-81057: Move the Cached Parser Dummy Name to _PyRuntimeState (#100277)
Merge branch 'main' into fastmock
Merge remote-tracking branch 'origin/main' into bpo_34697
gh-81057: Vendor a Subset of distutils for the c-analyzer Tool (gh-10…
gh-81057: Add a CI Check for New Unsupported C Global Variables (gh-1…
Merge branch 'main' into inlinecomp2
pythongh-81057: Add a CI Check for New Unsupported C Global Variables (…
pythongh-81057: Add a CI Check for New Unsupported C Global Variables (…
gh-81057: Inline single-use error messages in _decimal and make the r…