Skip to content
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

JLD error when using jldopen on a nested mutable struct before and after loading DSP.jl #313

Open
rgaudette opened this issue Mar 4, 2022 · 0 comments

Comments

@rgaudette
Copy link

I think I have found a strange interaction between JLD.jl and DSP.jl. If I call jldopen to save a nested mutable struct, then load DSP.jl, and then call jldopen to save a nested mutable struct again, I get the following error:

ERROR: LoadError: HDF5.API.H5Error("Error getting the number of members", 1008806316530991122).

This is using Julia 1.7.2, freshly updated.

Here is small section of code that I think captures the problem

using JLD

# If using DSP is executed here then this script does not crash
# using DSP

# If the following 2 structs are not mutable, this script does not crash
"""
A basic mutable X & Y Pair
"""
mutable struct MXYPair{T <: Real}
    x::T
    y::T
end # MXYPair

"""
A mutable 2D rectangle
"""
mutable struct MRectangle{T <: Real}
    origin::MXYPair{T}
    width::T
    height::T
end # Rectangle

mrect = MRectangle(MXYPair(1.0, 2.0), 3.0, 4.0)

# If using DSP is executed here then this script does not crash
# using DSP
jldopen("file1.jld", "w") do file
    write(file, "mrect", mrect)
end

# If the DSP module is loaded (using or import) JLD crashes on the following write
using DSP

jldopen("file2.jld", "w") do file
    write(file, "mrect", mrect)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant