Repository navigation
[subinterpreters] Global C variables are a problem #81057
Description
Activity
ericsnowcurrently commented
on May 10, 2019 MemberAuthorMore actionsWe 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:
- update check-c-globals.py to identify static locals (and thread-locals)
- deal with any identified globals
- move them to _PyRuntimeState (or thread-locals to PyThreadState, etc.)
- ignore them by adding them to Tools/c-globals/ignored-globals.txt
- add check-c-globals.py to "make check"
- (if "make check" isn't already there), ensure check-c-globals.py is run at some point in CI
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.
- addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)3.8 (EOL)end of lifeend of life
on May 10, 2019 - addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on May 10, 2019 ericsnowcurrently commented
on May 10, 2019 MemberAuthorMore actionsAlso, 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 commented
on Sep 11, 2019 MemberAuthorMore actionsThe 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 commented
on Sep 12, 2019 MemberAuthorMore actions@db3l, I'll take a look right away.
ericsnowcurrently commented
on Sep 12, 2019 MemberAuthorMore actionsericsnowcurrently commented
on Sep 12, 2019 MemberAuthorMore actionsericsnowcurrently commented
on Oct 19, 2019 MemberAuthorMore actionsNew changeset 9def81a by Vinay Sajip in branch 'master':
bpo-36876: Moved Parser/listnode.c statics to interpreter state. (GH-16328)
9def81aericsnowcurrently commented
on Nov 23, 2019 MemberAuthorMore actionsThanks, Vinay!
ericsnowcurrently commented
on Nov 23, 2019 MemberAuthorMore actionsFYI, others have been tackling this in separate issues (e.g. Victor, anyone relative to PEP-384).
44 remaining items
- added 4 commits that reference this issue
on Dec 12, 2022 - added a commit that references this issue
on Dec 14, 2022 - added a commit that references this issue
on Dec 16, 2022 - added a commit that references this issue
on Dec 18, 2022 - added a commit that references this issue
on Mar 14, 2023
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
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:
bugs.python.org fields: