gh-140306: Fix memory leaks in cross-interpreter data handling#140307
gh-140306: Fix memory leaks in cross-interpreter data handling#140307serhiy-storchaka merged 5 commits intopython:mainfrom
Conversation
Before
After
|
|
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 :) |
|
I think there're leaks there, you can find them with But we can fix them in a separate PR. |
Misc/NEWS.d/next/Core_and_Builtins/2025-10-18-21-29-45.gh-issue-140306.xS5CcS.rst
Outdated
Show resolved
Hide resolved
|
|
serhiy-storchaka
left a comment
There was a problem hiding this comment.
And please fix all other occurrences of XID_IGNORE_EXC & XID_FREE if there are any.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
There are no more such places in the code. |
|
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 commit f932321) Co-authored-by: Shamil <ashm.tech@proton.me>
|
GH-140338 is a backport of this pull request to the 3.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 commit f932321) 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 commit f932321) Co-authored-by: Shamil <ashm.tech@proton.me>
…ndling (pythonGH-140307) (cherry picked from commit f932321) Co-authored-by: Shamil <ashm.tech@proton.me>
|
GH-140357 is a backport of this pull request to the 3.13 branch. |
…ndling (pythonGH-140307) (cherry picked from commit f932321) Co-authored-by: Shamil <ashm.tech@proton.me>
…ndling (pythonGH-140307) (cherry picked from commit f932321) Co-authored-by: Shamil <ashm.tech@proton.me>
…GH-140307) (GH-140357) (cherry picked from commit f932321) Co-authored-by: Shamil <ashm.tech@proton.me>
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.