JuliaIO / MAT.jl

Julia module for reading MATLAB files
MIT License
278 stars 71 forks source link

HDF5 error only on Windows #117

Closed urlicht closed 3 years ago

urlicht commented 5 years ago

The following error (see the stacktrace) occurs for some .mat files, only on Windows (Windows 10, Julia 1.1, latest stable MAT.jl). In Linux (16.04), the package is able to read the file. The HDF5 package itself is functional without any issues.

julia> data=MAT.matread(path);
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
  #000: /home/abuild/rpmbuild/BUILD/hdf5-1.8.13/src/H5A.c line 1302 in H5Aget_type(): unable to register datatype ID
    major: Object atom
    minor: Unable to register new atom
  #001: /home/abuild/rpmbuild/BUILD/hdf5-1.8.13/src/H5I.c line 895 in H5I_register(): can't insert ID node into skip list
    major: Object atom
    minor: Unable to insert object
  #002: /home/abuild/rpmbuild/BUILD/hdf5-1.8.13/src/H5SL.c line 995 in H5SL_insert(): can't create new skip list node
    major: Skip Lists
    minor: Unable to insert object
  #003: /home/abuild/rpmbuild/BUILD/hdf5-1.8.13/src/H5SL.c line 687 in H5SL_insert_common(): can't insert duplicate key
    major: Skip Lists
    minor: Unable to insert object
ERROR: Error getting attribute type
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] datatype at C:\Users\$USERNAME\.julia\dev\HDF5\src\HDF5.jl:2250 [inlined]
 [3] hdf5_to_julia(::HDF5Attribute) at C:\Users\$USERNAME\.julia\dev\HDF5\src\HDF5.jl:1884
 [4] read(::HDF5Attribute) at C:\Users\$USERNAME\.julia\dev\HDF5\src\HDF5.jl:1299
 [5] a_read(::HDF5Group, ::String) at C:\Users\$USERNAME\.julia\dev\HDF5\src\HDF5.jl:1275
 [6] m_read(::HDF5Group) at C:\Users\$USERNAME\.julia\packages\MAT\UpKPb\src\MAT_HDF5.jl:197
 [7] read(::MAT.MAT_HDF5.MatlabHDF5File, ::String) at C:\Users\$USERNAME\.julia\packages\MAT\UpKPb\src\MAT_HDF5.jl:260
 [8] read(::MAT.MAT_HDF5.MatlabHDF5File) at C:\Users\$USERNAME\.julia\dev\HDF5\src\datafile.jl:45
 [9] matread(::String) at C:\Users\$USERNAME\.julia\packages\MAT\UpKPb\src\MAT.jl:130
 [10] top-level scope at none:0
urlicht commented 5 years ago

This seems to be an issue with HDF5 package on Windows. HDF5 on Windows uses 1.8.13. I installed 1.8.21 instead, and now MAT.jl can load the files.

musm commented 3 years ago

Should be fixed?