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

Zstd Decompress does support files compressed by newer C version? #150

Closed
coolcfxp opened this issue Aug 12, 2022 · 6 comments
Closed

Zstd Decompress does support files compressed by newer C version? #150

coolcfxp opened this issue Aug 12, 2022 · 6 comments

Comments

@coolcfxp
Copy link

I was recently trying to use this library to decode a compressed HDF5 file, the compression side uses the native library version 1.4.5, when I tried to decode it reports "Input is corrupted: offset=2305". Then I switched to zstd-jni, it worked. I wonder if the later versions or some strategies (or levels) are not supported?

@coolcfxp coolcfxp changed the title Zstd Decompress support version? Zstd Decompress does support files compressed by newer C version? Aug 12, 2022
@dain
Copy link
Member

dain commented Aug 12, 2022

It is likely a bug. Can you share a file that reproduces this? These kinds of bugs are generally impossible to fix without a reproduction.

@dain
Copy link
Member

dain commented Aug 12, 2022

Also a stack trace would help.

BTW did you try decoding the file to make sure it was not corrupted? Some of the native libraries for zstd disabled the corruption checks to improve performance, so it "works" but the output is actually corrupted.

@coolcfxp
Copy link
Author

I was using this along with the jhdf (https://github.com/jamesmudd/jhdf), as a filter.
When I reported this issue I thought it was the decoder's problem, but later when I tried to isolate a frame of data which reported an error to a separate file, and used AC to decode it, it didn't report an error.

So I thought it might be threading issue. So then I tried to use ThreadLocal, and just create a new instance every time when I needed to, the old corruption error disappeared, instead it gets a coredump, which I could not comprehence.

hs_err_pid2188.log

The original file is about 1.7Gb, I'm not sure hot to send it to you.

@dain
Copy link
Member

dain commented Aug 14, 2022

The hs error log doesn't really help, because it just says that the VM crashed in the core JVM binary with no reference to aircompressor.

I'm not going to be able to dig through a 1.7GB file in a format I'm unfamiliar with. Can you isolate the problematic compressed frame and post just that frame?

@coolcfxp
Copy link
Author

the problem is, when I did so, there was no problem. I had to guess it has something to do with the jhdf lib as well. Let me try to bring this issue to the jhdf guy and see if he/she has some ideas. Will update when more to come.

@coolcfxp
Copy link
Author

I think I found the bug which was in my code. I assigned output length more than the size of the output array accidentally. It works now , sorry for bothering you with my own bug, and thank you very much...

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

2 participants