GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.12] gh-119213: Fix getargs.c to store state in InterpreterState... by 1st1 · Pull Request #119194 · python/cpython

Conversation

@1st1

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

Uh oh!

There was an error while loading. Please reload this page.

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.

  • Issue: getargs.c is Breaking Interpeter Isolation #119213

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Yury Selivanov
Fix getargs.c to store state in InterpreterState...
b4650ba
...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.
@1st1
1st1 requested a review from ericsnowcurrently May 20, 2024 01:28
@bedevere-app bedevere-app Bot added the awaiting core review label May 20, 2024
1st1
1st1 commented May 20, 2024
View reviewed changes
Comment thread Include/internal/pycore_runtime.h
#include "pycore_unicodeobject.h" // struct _Py_unicode_runtime_ids

struct _getargs_runtime_state {
PyThread_type_lock mutex;

@1st1 1st1 May 20, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@1st1 1st1 mentioned this pull request May 20, 2024
gh-119213: Fix getargs.c to store state in InterpreterState... #119195
Closed
Yury Selivanov added 3 commits May 19, 2024 21:40
Yury Selivanov
Add the removed struct from PyRuntime back to preserve ABI
4339e3e
Yury Selivanov
Drop unintentionally added #include
2a30e1c
Yury Selivanov
Move the newly added struct to the end of the _is struct
83d05d1
@ericsnowcurrently 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
@bedevere-app bedevere-app Bot mentioned this pull request May 20, 2024
getargs.c is Breaking Interpeter Isolation #119213
Closed
@Eclips4 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
@ericsnowcurrently

ericsnowcurrently commented May 22, 2024

Copy link
Copy Markdown
Member

superseded by gh-119425

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently ericsnowcurrently closed this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@1st1 @ericsnowcurrently
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.