JLD.jl icon indicating copy to clipboard operation
JLD.jl copied to clipboard

TypeError: getfield: expected Symbol, got Int64

Open Keno opened this issue 9 years ago • 3 comments
trafficstars

julia> @save "tachyon1.jlprof" li lidict
WARNING: Method definition h5convert!(Ptr, JLD.JldFile, Bool, JLD.JldWriteSession) in module JLD at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590 overwritten at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590.
WARNING: Method definition h5convert!(Ptr, JLD.JldFile, Bool, JLD.JldWriteSession) in module JLD at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590 overwritten at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590.
WARNING: Method definition h5convert!(Ptr, JLD.JldFile, Bool, JLD.JldWriteSession) in module JLD at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590 overwritten at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590.
WARNING: Method definition h5convert!(Ptr, JLD.JldFile, Bool, JLD.JldWriteSession) in module JLD at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590 overwritten at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590.
WARNING: Method definition h5convert!(Ptr, JLD.JldFile, Bool, JLD.JldWriteSession) in module JLD at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590 overwritten at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:590.
ERROR: TypeError: getfield: expected Symbol, got Int64
 in h5convert!(::Ptr{UInt8}, ::JLD.JldFile, ::Module, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:627
 in #write_compound#15(::Array{Any,1}, ::Any, ::JLD.JldGroup, ::ASCIIString, ::Module, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:693
 in write_ref(::JLD.JldFile, ::Module, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:651
 in h5convert_array(::JLD.JldFile, ::Array{Any,1}, ::JLD.JldDatatype, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:595
 in #_write#11(::Array{Any,1}, ::Any, ::JLD.JldGroup, ::ASCIIString, ::Array{Any,1}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:559
 in write_ref(::JLD.JldFile, ::Array{Any,1}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:651
 [inlined code] from /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:615
 in h5convert!(::Ptr{UInt8}, ::JLD.JldFile, ::LambdaInfo, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:627
 in #write_compound#15(::Array{Any,1}, ::Any, ::JLD.JldGroup, ::ASCIIString, ::LambdaInfo, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:693
 in write_ref(::JLD.JldFile, ::LambdaInfo, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:651
 [inlined code] from /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:615
 in h5convert!(::Ptr{UInt8}, ::JLD.JldFile, ::Nullable{LambdaInfo}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:627
 in #write_compound#15(::Array{Any,1}, ::Any, ::JLD.JldGroup, ::ASCIIString, ::Nullable{LambdaInfo}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:693
 in write_ref(::JLD.JldFile, ::Nullable{LambdaInfo}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:651
 [inlined code] from /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:615
 in h5convert!(::Ptr{UInt8}, ::JLD.JldFile, ::StackFrame, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:627
 in #write_compound#15(::Array{Any,1}, ::Any, ::JLD.JldGroup, ::ASCIIString, ::StackFrame, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:693
 [inlined code] from ./boot.jl:303
 in #_write#14(::Array{Any,1}, ::Any, ::JLD.JldGroup, ::ASCIIString, ::StackFrame, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:687
 in write_ref(::JLD.JldFile, ::StackFrame, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:651
 in h5convert_array(::JLD.JldFile, ::Array{StackFrame,1}, ::JLD.JldDatatype, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:595
 in #_write#11(::Array{Any,1}, ::Any, ::JLD.JldGroup, ::ASCIIString, ::Array{StackFrame,1}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:559
 in write_ref(::JLD.JldFile, ::Array{StackFrame,1}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:651
 [inlined code] from /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:615
 in h5convert!(::Ptr{UInt8}, ::JLD.JldFile, ::JLD.AssociativeWrapper{UInt64,StackFrame,Dict{UInt64,StackFrame}}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/jld_types.jl:627
 in #write_compound#15(::Array{Any,1}, ::Any, ::JLD.JldFile, ::ASCIIString, ::JLD.AssociativeWrapper{UInt64,StackFrame,Dict{UInt64,StackFrame}}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:693
 in #_write#14(::Array{Any,1}, ::Any, ::JLD.JldFile, ::ASCIIString, ::JLD.AssociativeWrapper{UInt64,StackFrame,Dict{UInt64,StackFrame}}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:682
 [inlined code] from ./boot.jl:303
 in #write#8(::Array{Any,1}, ::Any, ::JLD.JldFile, ::ASCIIString, ::Dict{UInt64,StackFrame}, ::JLD.JldWriteSession) at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:682
 in anonymous at /home/kfischer/.julia/v0.5/JLD/src/JLD.jl:1127
 in eval(::Module, ::Any) at ./boot.jl:237

Keno avatar Apr 09 '16 23:04 Keno

I am getting a similar ERROR: TypeError: getfield: expected Symbol, got Int64 when trying to save a value of composite type, including anonymous function, which I expect to pose the problem in my case (as I experienced problems with them and JLD all along).

axsk avatar May 20 '16 09:05 axsk

For the top case, I don't get the reported error, instead I get ERROR: cannot write a pointer to JLD file. This turns out to be because backtraces now return StackFrame which includes Nullable{LambdaInfo} and LambdaInfo.fptr is of type Ptr{Void}. So someone is going to have to create writeas/readas methods for StackFrame, but of course this will result in the fptr effectively being thrown away.

@axsk, your case doesn't include enough detail to replicate. But anonymous functions are extremely problematic overall, and at the moment it doesn't seem that anyone has a clear path for them going forward with julia-0.5.

timholy avatar May 20 '16 11:05 timholy

I got this error while saving macroexpanded code that contains module. Eg. JLD.save("temp.jld", "somemodule", Base) triggers it. A nice error message would make it easier to spot the problem.

cstjean avatar Jun 29 '17 01:06 cstjean