Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-143249: Fix buffer leak when overlapped operation fails to start (OS-Windows)#143250
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
picnixz left a comment• 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.
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.
You'll need a NEWS entry for that and some tests as well. Please add them so that we can run them under the refleak bot as well.
cc@zooba
Uh oh!
There was an error while loading.Please reload this page.
This reverts commit2508cfb.
hyongtao-code commentedDec 28, 2025
Thanks for the review. I will add a suitable test case. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
serhiy-storchaka left a comment
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. 👍
103a384 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@hyongtao-code for the PR, and@kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…tart on windows (pythonGH-143250)(cherry picked from commit103a384)Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
…tart on windows (pythonGH-143250)(cherry picked from commit103a384)Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
GH-143795 is a backport of this pull request to the3.14 branch. |
GH-143796 is a backport of this pull request to the3.13 branch. |
Uh oh!
There was an error while loading.Please reload this page.
On Windows, some overlapped I/O operations leak buffers when they fail to start, notably in
WSASendTo(),WSARecvFrom(), andWSARecvFromInto().This change ensures that buffers are released on failure by clearing the overlapped state, following the same pattern used in other overlapped error paths. This issue is similar in nature to commit5485085, which fixed related overlapped cleanup problems.
Python script for tracking leaks
Result without the patch
Result with the patch