Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-140306: Fix memory leaks in cross-interpreter data handling#140307
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
BeforeAfter |
I've also found similar bug in |
Each variant needs to be carefully checked there, because some are correct and some aren't. I didn't look at the others because there were no leaks there :) |
efimov-mikhail commentedOct 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I think there're leaks there, you can find them with But we can fix them in a separate PR. |
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Core_and_Builtins/2025-10-18-21-29-45.gh-issue-140306.xS5CcS.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
|
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.
And please fix all other occurrences ofXID_IGNORE_EXC & XID_FREE if there are any.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
There are no more such places in the code. |
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. 👍
f932321 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@ashm-dev for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…ythonGH-140307)(cherry picked from commitf932321)Co-authored-by: Shamil <ashm.tech@proton.me>
GH-140338 is a backport of this pull request to the3.14 branch. |
Thanks@ashm-dev for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks@ashm-dev for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry,@ashm-dev and@serhiy-storchaka, I could not cleanly backport this to |
…ythonGH-140307)(cherry picked from commitf932321)Co-authored-by: Shamil <ashm.tech@proton.me>
Sorry@ashm-dev and@serhiy-storchaka, I had trouble completing the backport. |
…GH-140307) (GH-140338)(cherry picked from commitf932321)Co-authored-by: Shamil <ashm.tech@proton.me>
…ndling (pythonGH-140307)(cherry picked from commitf932321)Co-authored-by: Shamil <ashm.tech@proton.me>
GH-140357 is a backport of this pull request to the3.13 branch. |
…ndling (pythonGH-140307)(cherry picked from commitf932321)Co-authored-by: Shamil <ashm.tech@proton.me>
…ndling (pythonGH-140307)(cherry picked from commitf932321)Co-authored-by: Shamil <ashm.tech@proton.me>
…GH-140307) (GH-140357)(cherry picked from commitf932321)Co-authored-by: Shamil <ashm.tech@proton.me>
Uh oh!
There was an error while loading.Please reload this page.
Fixes three memory leaks detected by LeakSanitizer in cross-interpreter operations:
_interpchannelsmodule.c: Fixed bitwise AND (&) incorrectly used instead of OR (|) when combiningXID_IGNORE_EXCandXID_FREEflagscrossinterp.c(_release_xid_data): Fixed inverted ternary operator logic causing memory to be freed when it shouldn't and vice versacrossinterp.c(_PyXI_InitFailure): Added missingPyMem_RawFree()call in error pathReduced memory leaks from 1565 bytes to 0 bytes in
test__interpchannels.