-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Sockets.get(peer|sock)name on closed TCPSocket segfaults #40993
Comments
Normally we'd call |
I'm pretty new to contributing to open-source and Julia, but it sounds like the solution is really just adding the check_open(sock) check to the top of the function (I took a look at check_open and it throws an error itself). If I understood that correctly, I'd like to take this issue. |
…t checking could lead to a segfault on closed TCPSockets, see JuliaLang#40993
The remote IP is used in access logging but if the connection is closed at the time of creating the log message it is not possible to fetch it. (In fact, it currently segfaults, but will error in future Julia versions, see JuliaLang/julia#40993). This should not cost anything since the call to Sockets.getpeername(...) is already there for storing the remote port.
The remote IP is used in access logging but if the connection is closed at the time of creating the log message it is not possible to fetch it. (In fact, it currently segfaults, but will error in future Julia versions, see JuliaLang/julia#40993). This should not cost anything since the call to Sockets.getpeername(...) is already there for storing the remote port.
The remote IP is used in access logging but if the connection is closed at the time of creating the log message it is not possible to fetch it. (In fact, it currently segfaults, but will error in future Julia versions, see JuliaLang/julia#40993). This should not cost anything since the call to Sockets.getpeername(...) is already there for storing the remote port.
The remote IP is used in access logging but if the connection is closed at the time of creating the log message it is not possible to fetch it. (In fact, it currently segfaults, but will error in future Julia versions, see JuliaLang/julia#40993). This should not cost anything since the call to Sockets.getpeername(...) is already there for storing the remote port.
The remote IP is used in access logging but if the connection is closed at the time of creating the log message it is not possible to fetch it. (In fact, it currently segfaults, but will error in future Julia versions, see JuliaLang/julia#40993). With this patch the remote IP is stored in the Connection struct. This should not cost anything extras since the call to Sockets.getpeername(...) is already there for storing the remote port.
The remote IP is used in access logging but if the connection is closed at the time of creating the log message it is not possible to fetch it. (In fact, it currently segfaults, but will error in future Julia versions, see JuliaLang/julia#40993). With this patch the remote IP is stored in the Connection struct. This should not cost anything extras since the call to Sockets.getpeername(...) is already there for storing the remote port.
Hi again, nested task error: ArgumentError: TCPSocket(RawFD(19) init, 0 bytes waiting) is not initialized from runtests.jl, starting at line 93. Sorry for probably adding more work than I solved, but I'm in a bit over my head with this large a codebase and I can't figure it out. My pull request is #41000 for a closer look at the buildbot. |
Not checking could lead to a segfault on closed TCPSockets in getpeername Fixes JuliaLang#40993
Not checking could lead to a segfault on closed TCPSockets in getpeername Fixes JuliaLang#40993
Could probably be an error instead?
sock.handle
is a null pointer herejulia/stdlib/Sockets/src/Sockets.jl
Line 817 in 5dbf45a
julia/stdlib/Sockets/src/Sockets.jl
Line 821 in 5dbf45a
Would
peer = isopen(sock) ? getpeername(sock) : nothing
be a safe alternative to avoid this segfault (or error if this issue is fixed)?The text was updated successfully, but these errors were encountered: