-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-47182: Fix crash by named unicode characters after interpreter reinitialization #32212
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
Conversation
e44d28d
to
746ee08
Compare
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, but consider adding a comment ;-)
If you are motivated, you can add a test to test_embed using test_repeated_init_exec: see test_finalize_structseq() of test_embed for example. You can run arbitrary Python code, it's executed multiple times, each time the interpreter is created/destroyed in the same process.
I have added a comment and a test case. |
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, thanks for adding a regression test!
@tiran: Status check is done, and it's a success ✅ . |
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8, 3.9, 3.10. |
Sorry, @tiran, I could not cleanly backport this to |
Sorry @tiran, I had trouble checking out the |
Sorry, @tiran, I could not cleanly backport this to |
Sorry @tiran, I had trouble checking out the |
Are you sure that Python 3.10 and older are affected? Clearing interned strings is new in Python 3.10. Python 3.11 changed that with immortal code objects and immortal strings. In Python 3.9, strings were not really cleared by Py_Finalize(). They just leaked. |
…eter reinitialization (pythonGH-32212) Automerge-Triggered-By: GH:tiran. (cherry picked from commit 44e9150) Co-authored-by: Christian Heimes <[email protected]>
…ter reinitialization (pythonGH-32212) Automerge-Triggered-By: GH:tiran. (cherry picked from commit 44e9150) Co-authored-by: Christian Heimes <[email protected]>
GH-32216 is a backport of this pull request to the 3.10 branch. |
GH-32217 is a backport of this pull request to the 3.9 branch. |
3.9 and earlier are definitely not affected. It doesn't hurt to backport the change to 3.10. |
Yeah, I agree to backport to 3.10. But you have to backport manually, _testembed doesn't have test_repeated_init_exec. |
…eter reinitialization (GH-32212) (GH-32216) Co-authored-by: Christian Heimes <[email protected]>
https://bugs.python.org/issue47182
Automerge-Triggered-By: GH:tiran