Julia: Can't index into a Dict{Int,Type} after running BaseBenchmarks.loadall!()

Created on 14 Mar 2017  路  13Comments  路  Source: JuliaLang/julia

In the last couple of days something broke the following

d = Dict{Int,Type}()
d[1] = Int

this in turns breaks JLD and BenchmarkTools

bug types and dispatch

Most helpful comment

All 13 comments

What's your version? 0.6.0-pre.alpha.142 64409a0cae works fine for me.

Ok, seems I made a mistake, seems that is #20720 which would break this (weirdly enough that doesn't touches inference).

be sure to add a test for that?

On https://github.com/JuliaLang/julia/commit/1820efaf253d3efb981dbce3dc5aadff0be459c9, if I do

d = Dict{Int,Type}()
d[1] = Int

everything works, but if do (on a fresh REPL)

using BaseBenchmarks
BaseBenchmarks.loadall!() # this fails setindex!-ing a Dict{Int,Type}
d = Dict{Int,Type}()
d[1] = Int

the last one fails here

Could you post the error, or whatever output there is?

julia> using BaseBenchmarks

julia> BaseBenchmarks.loadall!()
loading group "string"...done (took 0.588424233 seconds)
loading group "linalg"...WARNING: filter(flt, itr) is deprecated, use Iterators.filter(flt, itr) instead.
Stacktrace:
 [1] depwarn(::String, ::Symbol) at ./deprecated.jl:64
 [2] filter(::Function, ::NTuple{7,UnionAll}) at ./deprecated.jl:51
 [3] include_from_node1(::String) at ./loading.jl:539
 [4] include(::String) at ./sysimg.jl:14
 [5] #load!#2(::Bool, ::Function, ::BenchmarkTools.BenchmarkGroup, ::String) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:39
 [6] (::BaseBenchmarks.#kw##load!)(::Array{Any,1}, ::BaseBenchmarks.#load!, ::BenchmarkTools.BenchmarkGroup, ::String) at ./<missing>:0
 [7] #loadall!#6(::Bool, ::Bool, ::Function, ::BenchmarkTools.BenchmarkGroup) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:53
 [8] #loadall!#5(::Array{Any,1}, ::Function) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:48
 [9] loadall!() at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:48
 [10] eval(::Module, ::Any) at ./boot.jl:235
 [11] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:66
 [12] macro expansion at ./REPL.jl:97 [inlined]
 [13] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
while loading /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/linalg/LinAlgBenchmarks.jl, in expression starting on line 16
done (took 11.765382401 seconds)
loading group "parallel"...done (took 0.104855176 seconds)
loading group "tuple"...done (took 2.974122399 seconds)
loading group "dates"...done (took 2.038936224 seconds)
loading group "micro"...done (took 0.517584081 seconds)
loading group "io"...done (took 0.570476438 seconds)
loading group "scalar"...done (took 29.934090327 seconds)
loading group "sparse"...done (took 5.464621647 seconds)
loading group "broadcast"...done (took 1.510048523 seconds)
loading group "simd"...done (took 2.550524409 seconds)
loading group "problem"...
WARNING: deprecated syntax "typealias IMDBGraph Dict{UTF8String,IMDBNode}" at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/problem/IMDBGraphs.jl:15.
Use "const IMDBGraph = Dict{UTF8String,IMDBNode}" instead.

WARNING: deprecated syntax "abstract Scene" at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/problem/Raytracer.jl:41.
Use "abstract type Scene end" instead.
done (took 1.996170801 seconds)
loading group "array"...
WARNING: deprecated syntax "abstract MyArray{T,N}<:AbstractArray{T,N}" at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/array/sumindex.jl:199.
Use "abstract type MyArray{T,N}<:AbstractArray{T,N} end" instead.
WARNING: Base.linearindexing is deprecated, use Base.IndexStyle instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/array/sumindex.jl:263
WARNING: Partial linear indexing is deprecated. Use `reshape(A, Val{2})` to make the dimensionality of the array match the number of indices.
Stacktrace:
 [1] partial_linear_indexing_warning_lookup(::Int64) at ./deprecated.jl:1050
 [2] checkbounds_linear_indices at ./abstractarray.jl:402 [inlined]
 [3] checkbounds_indices at ./abstractarray.jl:395 [inlined]
 [4] checkbounds_indices at ./abstractarray.jl:381 [inlined]
 [5] checkbounds at ./abstractarray.jl:334 [inlined]
 [6] checkbounds(::SubArray{Int32,3,Array{Int32,3},Tuple{Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}}},true}, ::Base.Slice{Base.OneTo{Int64}}, ::UnitRange{Int64}) at ./abstractarray.jl:354
 [7] view(::SubArray{Int32,3,Array{Int32,3},Tuple{Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}}},true}, ::Colon, ::Vararg{Any,N} where N) at ./subarray.jl:113
 [8] makearrays(::Type{Int32}, ::Int64, ::Int64) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/array/sumindex.jl:298
 [9] include_from_node1(::String) at ./loading.jl:539
 [10] include(::String) at ./sysimg.jl:14
 [11] #load!#2(::Bool, ::Function, ::BenchmarkTools.BenchmarkGroup, ::String) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:39
 [12] (::BaseBenchmarks.#kw##load!)(::Array{Any,1}, ::BaseBenchmarks.#load!, ::BenchmarkTools.BenchmarkGroup, ::String) at ./<missing>:0
 [13] #loadall!#6(::Bool, ::Bool, ::Function, ::BenchmarkTools.BenchmarkGroup) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:53
 [14] #loadall!#5(::Array{Any,1}, ::Function) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:48
 [15] loadall!() at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:48
 [16] eval(::Module, ::Any) at ./boot.jl:235
 [17] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:66
 [18] macro expansion at ./REPL.jl:97 [inlined]
 [19] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
while loading /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/array/ArrayBenchmarks.jl, in expression starting on line 47
done (took 30.402400938 seconds)
loading group "misc"...done (took 1.779329819 seconds)
loading group "sort"...done (took 3.917152019 seconds)
loading group "nullable"...WARNING: Base.linearindexing is deprecated, use Base.IndexStyle instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:56
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
WARNING: Base.LinearFast is deprecated, use Base.IndexLinear instead.
  likely near /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/nullable/NullableBenchmarks.jl:85
done (took 7.701400756 seconds)
loading group "shootout"...
WARNING: deprecated syntax "abstract BTree" at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/shootout/binary_trees.jl:8.
Use "abstract type BTree end" instead.
done (took 0.947569795 seconds)
ERROR: MethodError: First argument to `convert` must be a Type, got V
Stacktrace:
 [1] setindex!(::Dict{Int64,Type}, ::Type, ::Int64) at ./dict.jl:420
 [2] setindex!(::Dict{Int64,Type}, ::Type{T} where T, ::UInt64) at ./dict.jl:416
 [3] jldatatype(::JLD.JldFile, ::HDF5.HDF5Datatype) at /home/pabloferz/.julia/v0.6/JLD/src/jld_types.jl:754
 [4] read(::JLD.JldDataset) at /home/pabloferz/.julia/v0.6/JLD/src/JLD.jl:385
 [5] read(::JLD.JldFile, ::String) at /home/pabloferz/.julia/v0.6/JLD/src/JLD.jl:361
 [6] (::BaseBenchmarks.##7#8{BenchmarkTools.BenchmarkGroup})(::JLD.JldFile) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:59
 [7] #jldopen#11(::Array{Any,1}, ::Function, ::BaseBenchmarks.##7#8{BenchmarkTools.BenchmarkGroup}, ::String, ::Vararg{String,N} where N) at /home/pabloferz/.julia/v0.6/JLD/src/JLD.jl:260
 [8] #loadall!#6(::Bool, ::Bool, ::Function, ::BenchmarkTools.BenchmarkGroup) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:57
 [9] #loadall!#5(::Array{Any,1}, ::Function) at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:48
 [10] loadall!() at /home/pabloferz/.julia/v0.6/BaseBenchmarks/src/BaseBenchmarks.jl:48

@nanosoldier failed in the last daily run for the same reason. X-ref: https://github.com/JuliaLang/julia/commit/1820efaf253d3efb981dbce3dc5aadff0be459c9

Also, @nanosoldier was working yestarday, so it seems this started happening with https://github.com/JuliaLang/julia/commit/64409a0cae8b52d3f7953a4f9571f9987c7fbdfd

So far I have found that JLD creates julia types from strings using the function JLD.julia_type and then stores them on a field jlh5type of an object of type JldFile which is a Dict{Int,Type}.

It doesn't alway causes the problem and the only way I have found so far to trigger it is by calling

using BaseBenchmarks
BaseBenchmarks.load!("shootout")
Was this page helpful?
0 / 5 - 0 ratings

Related issues

manor picture manor  路  3Comments

wilburtownsend picture wilburtownsend  路  3Comments

TotalVerb picture TotalVerb  路  3Comments

yurivish picture yurivish  路  3Comments

Keno picture Keno  路  3Comments