Skip to content

Commit

Permalink
Add Base prefix to list_deletefirst! (#50852)
Browse files Browse the repository at this point in the history
I noticed this when debugging a bizarre issue, probably caused by some
earlier undefined behaviour, and I haven't been able to come up with
simple reproduction steps. It seems like `current_task().queue` is
basically never set after `wait()`. Based on
#32903 it seems like raising
SIGINT at the right time might trigger this.

In any case, if you manage to trigger it, `list_deletefirst!` will fail
because it is out of scope. I double-checked this using `@eval Sockets
list_deletefirst!` with Julia 1.9.2 (and there's only been one change to
`Sockets` since then).
  • Loading branch information
jonathan-conder-sm committed Aug 14, 2023
1 parent 513336a commit fd695a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stdlib/Sockets/src/Sockets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ function send(sock::UDPSocket, ipaddr::IPAddr, port::Integer, msg)
finally
Base.sigatomic_end()
iolock_begin()
ct.queue === nothing || list_deletefirst!(ct.queue, ct)
ct.queue === nothing || Base.list_deletefirst!(ct.queue, ct)
if uv_req_data(uvw) != C_NULL
# uvw is still alive,
# so make sure we won't get spurious notifications later
Expand Down
4 changes: 2 additions & 2 deletions stdlib/Sockets/src/addrinfo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function getalladdrinfo(host::String)
finally
Base.sigatomic_end()
iolock_begin()
ct.queue === nothing || list_deletefirst!(ct.queue, ct)
ct.queue === nothing || Base.list_deletefirst!(ct.queue, ct)
if uv_req_data(req) != C_NULL
# req is still alive,
# so make sure we don't get spurious notifications later
Expand Down Expand Up @@ -205,7 +205,7 @@ function getnameinfo(address::Union{IPv4, IPv6})
finally
Base.sigatomic_end()
iolock_begin()
ct.queue === nothing || list_deletefirst!(ct.queue, ct)
ct.queue === nothing || Base.list_deletefirst!(ct.queue, ct)
if uv_req_data(req) != C_NULL
# req is still alive,
# so make sure we don't get spurious notifications later
Expand Down

0 comments on commit fd695a7

Please sign in to comment.