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

matlab table causes trouble: zlib error: incorrect header check (code: -3) #915

Open
StefanPofahl opened this issue Mar 16, 2022 · 4 comments

Comments

@StefanPofahl
Copy link

StefanPofahl commented Mar 16, 2022

First of all thank you for this great tool and for the effort to make matlab-tables accessible!

I have a mat-file, containing a matlab-table.
If I use the command names() (which is deprecated) it works a little bit,
but if I use keys() instead it throws an error:
using MAT
hd_mat_file = matopen("filename.mat")
variable_keys = keys(hd_mat_file)
variable_names = names(hd_mat_file)

Here part of the error-message:
zlib error: incorrect header check (code: -3) changemode!(stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, newmode::Symbol) at stream.jl:717 callprocess(stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, inbuf::TranscodingStreams.Buffer, outbuf::TranscodingStreams.Buffer) at stream.jl:649 fillbuffer(stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}; eager::Bool) at stream.jl:577 fillbuffer at stream.jl:564 [inlined] [...]

A curiosity occurs on my machine (MS Windows 10, Julia v1.7.2):
If I call first names() and afterwards keys() it works (in the line-by-line-execution mode).

Unfortunately, the resulting Base.KeySet holds zero / 0 elements :-(

Regards,
Stefan

Table_PolCurve.zip

@musm
Copy link
Member

musm commented Mar 16, 2022

It looks like you are using MAT.jl ?
Which package versions are you using?

@StefanPofahl
Copy link
Author

Yes, MAT v0.10.3, HDF5 v0.16.3, the behavior is the same on Linux and MS Windows 10.

@tn9702135
Copy link

hi
I have an error to run line read() that error is below, I did your suggestion and using MAT v0.10.3, HDF5 v0.16.3.
but I did not work.

error:
LoadError: zlib error: incorrect header check (code: -3)
in expression starting at C:\Users\ECE_CPU_Node_20\Desktop\Dr_Forrester_network\PhD-Codes-master\Chapter-6\Delay_timeseries.jl:22
changemode!(stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, newmode::Symbol) at stream.jl:717
callprocess(stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, inbuf::TranscodingStreams.Buffer, outbuf::TranscodingStreams.Buffer) at stream.jl:649
fillbuffer(stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}; eager::Bool) at stream.jl:577
fillbuffer at stream.jl:564 [inlined]
eof(stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}) at stream.jl:188
unsafe_read(stream::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, output::Ptr{UInt8}, nbytes::UInt64) at stream.jl:356
unsafe_read at io.jl:724 [inlined]
unsafe_read(s::TranscodingStreams.TranscodingStream{CodecZlib.ZlibDecompressor, IOStream}, p::Base.RefValue{UInt32}, n::Int64) at io.jl:723
read! at io.jl:725 [inlined]
read at io.jl:729 [inlined]
read_bswap at MAT_v5.jl:83 [inlined]
read_header at MAT_v5.jl:110 [inlined]
getvarnames(matfile::MAT.MAT_v5.Matlabv5File) at MAT_v5.jl:396
keys at MAT_v5.jl:415 [inlined]
names(matfile::MAT.MAT_v5.Matlabv5File) at MAT.jl:176
top-level scope at Delay_timeseries.jl:22
eval at boot.jl:373 [inlined]
include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String) at loading.jl:1196

@mkitti
Copy link
Member

mkitti commented Aug 18, 2022

This is really a MAT.jl issue. In the meantime, does matread work per JuliaIO/MAT.jl#80 (comment)

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

4 participants