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 — gh-109700: fix interp finalization while handling memory error by kumaraditya303 · Pull Request #136342 · python/cpython

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Jul 6, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Issue: test_interpreters: test_create_many_threaded() failed on FreeBSD: log: RuntimeError: interpreter creation failed #109700

Sorry, something went wrong.

Uh oh!

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

All reactions
@kumaraditya303
fix interp finalization while handling memory error
ba1e603
@kumaraditya303
kumaraditya303 requested review from ZeroIntensity and ericsnowcurrently as code owners July 6, 2025 16:30
@kumaraditya303 kumaraditya303 added the skip news label Jul 6, 2025
@bedevere-app bedevere-app Bot added the awaiting core review label Jul 6, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jul 6, 2025
test_interpreters: test_create_many_threaded() failed on FreeBSD: log: RuntimeError: interpreter creation failed #109700
Closed
@kumaraditya303

kumaraditya303 commented Jul 6, 2025

Copy link
Copy Markdown
Contributor Author

!buildbot refleak*

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Jul 6, 2025

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit ba1e603 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136342%2Fmerge

The command will test the builders whose names match following regular expression: refleak*

The builders matched are:

  • AMD64 RHEL8 Refleaks PR
  • AMD64 Fedora Rawhide NoGIL refleaks PR
  • AMD64 CentOS9 Refleaks PR
  • s390x RHEL9 Refleaks PR
  • s390x Fedora Stable Refleaks PR
  • s390x Fedora Rawhide NoGIL refleaks PR
  • s390x Fedora Rawhide Refleaks PR
  • PPC64LE CentOS9 Refleaks PR
  • aarch64 Fedora Rawhide Refleaks PR
  • AMD64 Windows11 Refleaks PR
  • PPC64LE Fedora Rawhide Refleaks PR
  • AMD64 Fedora Stable Refleaks PR
  • PPC64LE Fedora Stable Refleaks PR
  • PPC64LE Fedora Rawhide NoGIL refleaks PR
  • AMD64 FreeBSD Refleaks PR
  • s390x RHEL8 Refleaks PR
  • AMD64 Fedora Rawhide Refleaks PR
  • aarch64 RHEL8 Refleaks PR
  • ARM64 MacOS M1 Refleaks NoGIL PR
  • PPC64LE RHEL8 Refleaks PR
  • aarch64 CentOS9 Refleaks PR
  • AMD64 CentOS9 NoGIL Refleaks PR
  • aarch64 Fedora Stable Refleaks PR
  • aarch64 Fedora Rawhide NoGIL refleaks PR
All reactions

Sorry, something went wrong.

Uh oh!

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

@serhiy-storchaka
serhiy-storchaka self-requested a review July 6, 2025 18:10
serhiy-storchaka
serhiy-storchaka approved these changes Jul 7, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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.

LGTM in principle. I afraid that calling Py_EndInterpreter() can introduce other crashes, because more clean up code can now be executed for not yet initialized parts. There are two ways to solve this:

  • Make Py_EndInterpreter() super robust.
  • Only call these clean up procedures which are necessary after each error.

In any way, it would be better to fix all potential crashes in one go. But if you prefer, you can merge this PR.

Sorry, something went wrong.

Uh oh!

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

ericsnowcurrently reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jul 7, 2025
@kumaraditya303

kumaraditya303 commented Jul 7, 2025

Copy link
Copy Markdown
Contributor Author

Make Py_EndInterpreter() super robust.

I would prefer to do that, it is better for user code too as it is public API but can be done after this.

ericsnowcurrently reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@kumaraditya303 kumaraditya303 added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Jul 7, 2025
@kumaraditya303
kumaraditya303 merged commit 0c3e3da into python:main Jul 7, 2025
@miss-islington-app

miss-islington-app Bot commented Jul 7, 2025

Copy link
Copy Markdown

Thanks @kumaraditya303 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Jul 7, 2025
@kumaraditya303
kumaraditya303 deleted the interp branch July 7, 2025 07:15
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 7, 2025
@kumaraditya303 @miss-islington
pythongh-109700: fix interpreter finalization while handling memory e…
36809ab
…rror (pythonGH-136342)

(cherry picked from commit 0c3e3da)

Co-authored-by: Kumar Aditya <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 7, 2025
@kumaraditya303 @miss-islington
pythongh-109700: fix interpreter finalization while handling memory e…
981fce1
…rror (pythonGH-136342)

(cherry picked from commit 0c3e3da)

Co-authored-by: Kumar Aditya <[email protected]>
@bedevere-app

bedevere-app Bot commented Jul 7, 2025

Copy link
Copy Markdown

GH-136352 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 7, 2025
@bedevere-app

bedevere-app Bot commented Jul 7, 2025

Copy link
Copy Markdown

GH-136353 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jul 7, 2025
kumaraditya303 added a commit that referenced this pull request Jul 7, 2025
@miss-islington @kumaraditya303
[3.13] gh-109700: fix interpreter finalization while handling memory …
2362cb6
…error (GH-136342) (#136353)

gh-109700: fix interpreter finalization while handling memory error (GH-136342)
(cherry picked from commit 0c3e3da)

Co-authored-by: Kumar Aditya <[email protected]>
kumaraditya303 added a commit that referenced this pull request Jul 7, 2025
@miss-islington @kumaraditya303
[3.14] gh-109700: fix interpreter finalization while handling memory …
22fad16
…error (GH-136342) (#136352)

gh-109700: fix interpreter finalization while handling memory error (GH-136342)
(cherry picked from commit 0c3e3da)

Co-authored-by: Kumar Aditya <[email protected]>
AndPuQing pushed a commit to AndPuQing/cpython that referenced this pull request Jul 11, 2025
@kumaraditya303 @AndPuQing
pythongh-109700: fix interpreter finalization while handling memory e…
25ca248
…rror (python#136342)
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@kumaraditya303 @Pranjal095
pythongh-109700: fix interpreter finalization while handling memory e…
3b8bc87
…rror (python#136342)
picnixz pushed a commit to picnixz/cpython that referenced this pull request Jul 13, 2025
@kumaraditya303 @picnixz
pythongh-109700: fix interpreter finalization while handling memory e…
e7a8024
…rror (python#136342)
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@kumaraditya303 @taegyunkim
pythongh-109700: fix interpreter finalization while handling memory e…
2282892
…rror (python#136342)
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
@kumaraditya303 @Agent-Hellboy
pythongh-109700: fix interpreter finalization while handling memory e…
f76985b
…rror (python#136342)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@ZeroIntensity ZeroIntensity Awaiting requested review from ZeroIntensity ZeroIntensity is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news

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.

3 participants

@kumaraditya303 @bedevere-bot @serhiy-storchaka
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.