You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deleting nothing from OrderedDict seems to behave wildly, is it a known issue?
julia>using OrderedCollections
julia> x =OrderedDict(2=>0.1, nothing=>0.2, 3=>0.5)
OrderedDict{Union{Nothing, Int64}, Float64} with 3 entries:2=>0.1nothing=>0.23=>0.5
julia>delete!(x, nothing)
OrderedDict{Union{Nothing, Int64}, Float64} with 2 entries:nothing=>0.1nothing=>0.2
julia> x
OrderedDict{Union{Nothing, Int64}, Float64} with 2 entries:nothing=>0.1nothing=>0.2
julia> x =OrderedDict(2=>0.1, 5=>0.4, 10=>0.4, nothing=>0.03)
OrderedDict{Union{Nothing, Int64}, Float64} with 4 entries:2=>0.15=>0.410=>0.4nothing=>0.03
julia>delete!(x, nothing)
OrderedDict{Union{Nothing, Int64}, Float64} with 3 entries:2=>0.15=>0.410=>0.4
julia> x
signal (11): Segmentation fault
in expression starting at none:0
jl_gc_pool_alloc at /buildworker/worker/package_linux64/build/src/gc.c:1217
Could this have something to do with these lines? Maybe jl_arrayunset is called with invalid arguments or something like that. But that's just a guess, I'm not familiar with these internals.
Not too familiar with the source code, but it looks like it happens in the rehash! function, where the code assumes that if the key is not a bitstype, it contains pointers (see the definition of the ptrs variable). This assumption is violated for union bitstypes, where the union is neither a bitstype, nor stored as a pointer.
Deleting
nothing
from OrderedDict seems to behave wildly, is it a known issue?For the segfault, I created an upstream report: JuliaLang/julia#45959 (comment)
The text was updated successfully, but these errors were encountered: