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

Segfault on Sockets._sockname #29087

Closed
quinnj opened this issue Sep 7, 2018 · 2 comments
Closed

Segfault on Sockets._sockname #29087

quinnj opened this issue Sep 7, 2018 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior good first issue Indicates a good issue for first-time contributors to Julia io Involving the I/O subsystem: libuv, read, write, etc.

Comments

@quinnj
Copy link
Member

quinnj commented Sep 7, 2018

Backtrace from HTTP.jl travis run:

running async 1, 1:100, Pair{Symbol,Int64}[:verbose=>0], http C
[ Info: Accept (1):  πŸ”—    0↑     0↓    0s 127.0.0.1:8081:8081 ≣16
(HTTP.Sockets).getsockname(http) = (ip"127.0.0.1", 0x1f91)[ Info: Closed (1):  πŸ’€    0↑     0β†“πŸ”’   0s 127.0.0.1:8081:8081 ≣16
signal (11): Segmentation fault: 11
in expression starting at /Users/travis/build/JuliaWeb/HTTP.jl/test/async.jl:189
uv_tcp_getsockname at /Users/osx/buildbot/slave/package_osx64/build/deps/srccache/libuv-ed3700c849289ed01fe04273a7bf865340b2bd7e/src/unix/tcp.c:222
jl_tcp_getsockname at /Users/osx/buildbot/slave/package_osx64/build/src/jl_uv.c:647
_sockname at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Sockets/src/Sockets.jl:601 [inlined]
getsockname at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Sockets/src/Sockets.jl:584 [inlined]
getsockname at /Users/travis/build/JuliaWeb/HTTP.jl/src/Streams.jl:59 [inlined]
macro expansion at ./show.jl:555 [inlined]
#109 at /Users/travis/build/JuliaWeb/HTTP.jl/test/async.jl:17
handle_stream at /Users/travis/build/JuliaWeb/HTTP.jl/src/Servers.jl:481
#54 at ./task.jl:259
jl_apply at /Users/osx/buildbot/slave/package_osx64/build/src/./julia.h:1558 [inlined]
start_task at /Users/osx/buildbot/slave/package_osx64/build/src/task.c:271
Allocations: 88437210 (Pool: 88416323; Big: 20887); GC: 198
ERROR: Package HTTP errored during testing
Stacktrace:
 [1] pkgerror(::String, ::Vararg{String,N} where N) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:120
 [2] macro expansion at ./logging.jl:313 [inlined]
 [3] #test#61(::Bool, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1284
 [4] #test at ./none:0 [inlined]
 [5] #test#42(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:267
 [6] #test at ./none:0 [inlined]
 [7] #test#41 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:250 [inlined]
 [8] #test at ./none:0 [inlined]
 [9] #test#38(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:coverage,),Tuple{Bool}}}, ::Function) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:247
 [10] (::getfield(Pkg.API, Symbol("#kw##test")))(::NamedTuple{(:coverage,),Tuple{Bool}}, ::typeof(Pkg.API.test)) at ./none:0
 [11] top-level scope at none:1

I'm wondering if we need some kind of assertion around

r = ccall(:jl_tcp_getsockname, Int32,
. The docs say it's only valid for connected sockets, so I imagine the HTTP.jl tests got into a situation where that happened to be the case (saw this error on 1/4 builds for a single PR).

@JeffBezanson JeffBezanson added the io Involving the I/O subsystem: libuv, read, write, etc. label Sep 10, 2018
@NHDaly
Copy link
Member

NHDaly commented Dec 7, 2021

Looks like this is missing a call to check_open(sock), like we do here:

check_open(sock)

@NHDaly NHDaly added bug Indicates an unexpected problem or unintended behavior good first issue Indicates a good issue for first-time contributors to Julia labels Dec 7, 2021
@NHDaly
Copy link
Member

NHDaly commented Dec 8, 2021

Fixed by #41000 (duplicate of #40993). :)

@NHDaly NHDaly closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior good first issue Indicates a good issue for first-time contributors to Julia io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

No branches or pull requests

3 participants