-
-
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
A large number of @spawnat
calls hangs
#15923
Comments
It is an issue with Dicts most probably due to a memory corruption. The looping is here - Lines 550 to 552 in fb81034
I tested with the below modification of that block.
and it loops around the following values:
which leads me to suspect a corruption somewhere. cc: @yuyichao |
Disabling |
This is a regression and is due to an interplay between the Dict code and GC which I don't fully understand. Tagging as 0.5. |
seems like it's a performance regression? adding a typeassert in diff --git a/base/dict.jl b/base/dict.jl
index 4ac15ae..d9bf6b1 100644
--- a/base/dict.jl
+++ b/base/dict.jl
@@ -9,15 +9,7 @@ haskey(d::Associative, k) = in(k,keys(d))
function in(p::Pair, a::Associative, valcmp=(==))
v = get(a,p[1],secret_table_token)
if !is(v, secret_table_token)
- if valcmp === is
- is(v, p[2]) && return true
- elseif valcmp === (==)
- ==(v, p[2]) && return true
- elseif valcmp === isequal
- isequal(v, p[2]) && return true
- else
- valcmp(v, p[2]) && return true
- end
+ valcmp(v, p[2]) && return true
end
return false
end
@@ -515,7 +507,7 @@ function convert{K,V}(::Type{Dict{K,V}},d::Associative)
end
convert{K,V}(::Type{Dict{K,V}},d::Dict{K,V}) = d
-hashindex(key, sz) = ((hash(key)%Int) & (sz-1)) + 1
+hashindex(key, sz) = (((hash(key)%Int) & (sz-1)) + 1)::Int
isslotempty(h::Dict, i::Int) = h.slots[i] == 0x0
isslotfilled(h::Dict, i::Int) = h.slots[i] == 0x1
@@ -616,7 +608,7 @@ function ht_keyindex{K,V}(h::Dict{K,V}, key)
if isslotempty(h,index)
break
end
- if !isslotmissing(h,index) && isequal(key,keys[index])
+ if !isslotmissing(h,index) && (key === keys[index] || isequal(key,keys[index]))
return index
end
@@ -650,7 +642,7 @@ function ht_keyindex2{K,V}(h::Dict{K,V}, key)
# in case "key" already exists in a later collided slot.
avail = -index
end
- elseif isequal(key, keys[index])
+ elseif key === keys[index] || isequal(key, keys[index])
return index
end
@@ -957,15 +949,7 @@ function in(key_value::Pair, dict::ImmutableDict, valcmp=(==))
key, value = key_value
while isdefined(dict, :parent)
if dict.key == key
- if valcmp === is
- is(value, dict.value) && return true
- elseif valcmp === (==)
- ==(value, dict.value) && return true
- elseif valcmp === isequal
- isequal(value, dict.value) && return true
- else
- valcmp(value, dict.value) && return true
- end
+ valcmp(value, dict.value) && return true
end
dict = dict.parent
end I think this may have been due to changes to the multi.jl code? After finishing, we see that the dictionary was 256x larger:
furthermore, upon calling |
The number of entries in |
yes, agreed – both should be 0
it appears that the order of finalizers is less predictable on master than it was on v0.4, yes
not necessarily – I think master may actually be faster at collecting them, the bug was in the finalizer (see 8d1970e) |
Thanks! |
Recent changes have rendered workaround #14456 moot.
The below test (run under JULIA_TESTFULL=1) hangs
A Ctrl-C prints
The underlying cause is probably related to #14445 (comment)
The text was updated successfully, but these errors were encountered: