FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.12] gh-119213: Fix getargs.c to store state in InterpreterState... by 1st1 · Pull Request #119194 · python/cpython · GitHub

/ cpython Public

[3.12] gh-119213: Fix getargs.c to store state in InterpreterState... - #119194

Closed
1st1 wants to merge 4 commits into
python:3.12from
1st1:fixargs312
Closed

[3.12] gh-119213: Fix getargs.c to store state in InterpreterState...#119194
1st1 wants to merge 4 commits into
python:3.12from
1st1:fixargs312

Conversation

1st1 commented May 20, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

...as opposed to storing it in PyRuntime. Storing it in PyRuntime is fundametally wrong, as its state contains references to Python objects. Those objects (tuples and strings) can (and will) be picked by various subinterpreter clean up code, leaving PyRuntime with broken pointers.

...as opposed to storing it in PyRuntime. Storing it in PyRuntime
is fundametally wrong, as its state contains references to Python
objects. Those objects (tuples and strings) can (and will) be
picked by various subinterpreter clean up code, leaving PyRuntime
with broken pointers.
#include "pycore_unicodeobject.h" // struct _Py_unicode_runtime_ids

struct _getargs_runtime_state {
PyThread_type_lock mutex;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think having a lock isn't necessary in 3.12 as we're muving this struct to InterpreterState. Local state modification will be protected by the GIL.

ericsnowcurrently changed the title Fix getargs.c to store state in InterpreterState... gh-119213: Fix getargs.c to store state in InterpreterState... May 20, 2024
Eclips4 changed the title gh-119213: Fix getargs.c to store state in InterpreterState... [3.12] gh-119213: Fix getargs.c to store state in InterpreterState... May 20, 2024

Copy link
Copy Markdown
Member

superseded by gh-119425

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL