Skip to content
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

Fix double-close crash after abort, Python 3.11 #180

Closed
wants to merge 1 commit into from

Conversation

xloem
Copy link
Contributor

@xloem xloem commented Jul 28, 2023

This addresses a crash I’ve been encountering with ssl on python 3.11 when the connection aborts unexpectedly.

@vmagamedov
Copy link
Owner

asyncio transports allow calling transport.close() more than once: https://github.com/python/cpython/blob/c163d7f0b67a568e9b64eeb9c1cbbaa127818596/Lib/asyncio/sslproto.py#L110-L114

@xloem
Copy link
Contributor Author

xloem commented Aug 25, 2023

I vaguely recall, if you check the section you hilighted, a second call to close() resets a member variable to None, causing other member functions to crash, whereas a single call does not do this.
edit: https://github.com/python/cpython/blob/c163d7f0b67a568e9b64eeb9c1cbbaa127818596/Lib/asyncio/sslproto.py#L113-L114

@vmagamedov
Copy link
Owner

Related to #185. Fix was implemented in other place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants