Skip to content

Commit

Permalink
fix #27933, don't eval value of global vars in cluster deserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 6, 2018
1 parent 6eed2fa commit d556784
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stdlib/Distributed/src/clusterserialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ function deserialize_global_from_main(s::ClusterSerializer, sym)
sym_isconst = deserialize(s)
v = deserialize(s)
if sym_isconst
@eval Main const $sym = $v
ccall(:jl_set_const, Cvoid, (Any, Any, Any), Main, sym, v)
else
@eval Main $sym = $v
ccall(:jl_set_global, Cvoid, (Any, Any, Any), Main, sym, v)
end
return nothing
end

function delete_global_tracker(s::ClusterSerializer, v)
Expand Down
4 changes: 4 additions & 0 deletions stdlib/Distributed/test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,10 @@ else
@info "SO_REUSEPORT is unsupported, skipping reuseport tests"
end

# issue #27933
a27933 = :_not_defined_27933
@test remotecall_fetch(()->a27933, first(workers())) === a27933

# Run topology tests last after removing all workers, since a given
# cluster at any time only supports a single topology.
rmprocs(workers())
Expand Down

0 comments on commit d556784

Please sign in to comment.