Issue 1:
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

julia/stdlib/Sockets/src/Sockets.jl

Line 601
in
5c1d4a3

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).

Issue 2:
Could probably be an error instead?

sock.handle is a null pointer here

julia/stdlib/Sockets/src/Sockets.jl

Line 817
in
5dbf45a

sock.handle, rport, raddress, rfamily)

and here

julia/stdlib/Sockets/src/Sockets.jl

Line 821
in
5dbf45a

sock.handle, rport, raddress, rfamily)

Would peer = isopen(sock) ? getpeername(sock) : nothing be a safe alternative to avoid this segfault (or error if this issue is fixed)?