8000 gh-109700: fix interp finalization while handling memory error by kumaraditya303 · Pull Request #136342 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-109700: fix interp finalization while handling memory error #136342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025

Conversation

kumaraditya303
Copy link
Contributor
@kumaraditya303 kumaraditya303 commented Jul 6, 2025

@kumaraditya303
Copy link
Contributor Author

!buildbot refleak*

@bedevere-bot
Copy link

🤖 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

@serhiy-storchaka serhiy-storchaka self-requested a review July 6, 2025 18:10
Copy link
Member
@serhiy-storchaka serhiy-storchaka left a 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.

@kumaraditya303
Copy link
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.

@kumaraditya303 kumaraditya303 added needs backport to 3.13 bugs and 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
75 checks passed
@miss-islington-app
Copy link

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

@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
…rror (pythonGH-136342)

(cherry picked from commit 0c3e3da19570424649c33c0c2c29dc12541935e7)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 7, 2025
…rror (pythonGH-136342)

(cherry picked from commit 0c3e3da)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@bedevere-app
Copy link
bedevere-app bot commented Jul 7, 2025

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

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jul 7, 2025
@bedevere-app
Copy link
bedevere-app bot commented Jul 7, 2025

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 7, 2025
kumaraditya303 added a commit that referenced this pull request Jul 7, 2025
…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 <kumaraditya@python.org>
kumaraditya303 added a commit that referenced this pull request Jul 7, 2025
…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 <kumaraditya@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0