-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Calling many methods on _ssl._SSLSocket()
segfaults
#126455
Comments
I can probably deal with this considering my previous work with |
Seems not to be related to free-threading, given being present in many previous versions. |
If you don't mind, can you give it to me :) |
The problem is that it's possible to create an invalid SSLSocket:
In the Python implementation, there is: class SSLSocket(socket):
def __init__(self, *args, **kwargs):
raise TypeError(
f"{self.__class__.__name__} does not have a public "
f"constructor. Instances are returned by "
f"SSLContext.wrap_socket()."
) Maybe the _ssl extension module needs a similar constructor. |
@rruuaanng: No, please do not. I suggest you instead focus on the many PRs you already have opened. Only when you're down to a handful of open PR, consider again to open a new PR. |
Prevent creation of incomplete/invalid _ssl.SSLSocket objects when created directly.
I wrote #126481 to fix the issue. |
Prevent creation of incomplete/invalid _ssl.SSLSocket objects when created directly.
Prevent creation of incomplete/invalid _ssl.SSLSocket objects when created directly. (cherry picked from commit b1c4ffc) Co-authored-by: Victor Stinner <vstinner@python.org>
Prevent creation of incomplete/invalid _ssl.SSLSocket objects when created directly. (cherry picked from commit b1c4ffc) Co-authored-by: Victor Stinner <vstinner@python.org>
Fixed. Thanks for the bug report. |
Thanks for working on this! |
Crash report
What happened?
Calling many different methods on a
_ssl._SSLSocket()
instance causes a segfault, for example:Other methods known to segfault are
do_handshake
,get_channel_binding
,get_verified_chain
(but notget_unverified_chain
),getpeercert
,read
,verify_client_post_handshake
,write
. Backtrace looks like:Found using fusil by @vstinner.
CPython versions tested on:
3.10, 3.11, 3.12, 3.13, 3.14, CPython main branch
Operating systems tested on:
Linux, Windows
Output from running 'python -VV' on the command line:
Python 3.14.0a1+ experimental free-threading build (heads/main-dirty:bfc1d2504c, Nov 4 2024, 07:55:58) [GCC 11.4.0]
Linked PRs
The text was updated successfully, but these errors were encountered: