-
Notifications
You must be signed in to change notification settings - Fork 14
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
Reusing a compressor #70
Comments
Maybe the |
No Julia call should ever segfault. Could we detect the condition and throw an error before segfaulting? I'm also thinking we should completely redo the JLD2 compression mechanjsm... |
Yes, that requires adding checks for null pointers everywhere the codec is used. |
With #72 I get julia> using CodecZstd, TranscodingStreams
julia> compressor = ZstdFrameCompressor()
ZstdFrameCompressor(level=3)
julia> x = rand(UInt8, 4*10^7);
julia> TranscodingStreams.initialize(compressor)
julia> ret1 = transcode(compressor, x);
julia> TranscodingStreams.finalize(compressor)
julia> TranscodingStreams.initialize(compressor)
ERROR: codec use after free
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] initialize(codec::ZstdCompressor)
@ CodecZstd ~/github/CodecZstd.jl/src/compression.jl:83
[3] top-level scope
@ REPL[7]:1 The benchmarks are unaffected as well. |
Absolutely, |
This was found here: JuliaIO/JLD2.jl#599
When using a
ZstdFrameCompressor
or aZstdCompressor
, you reproducably get a segfault when trying to reuse the same compressor instance:I don't know if this can be made to just work, but I hope that this can at least be caught in time and throw an error instead.
The text was updated successfully, but these errors were encountered: