-
Notifications
You must be signed in to change notification settings - Fork 79
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
Compress on 32bit BE, decompress on x86_64 LE #40
Comments
Hi, can you create a small example that
This should not happen and I'ld like to look into that issue. I would need to be able to reproduce it in a qemu VM, though. |
Hi @jheyens Sorry for late reply. Here you can find the relevant files gathered (input.txt, data_x86.bin, data_mips.bin, and data_mips_fork.be): https://www.dropbox.com/s/kobwxdo03t8oxfk/data_lz4.tar.gz?dl=0 To reproduce the problem please do following:
(you probably need docker in your system) Set up x86:
mips:
When running After dumping compressed data gathered from x86 and mips runs to files $ lz4cat data_x86.bin
Lorem ipsum... $ lz4cat data_mips.bin
Error 44 : Unrecognized header : file cannot be decoded Any help or idea is appreciated. It might seem like some obscure compile flags are missing from lz4-sys, but unfortunately I couldn't figure it out. |
@mpapierski - given the response on lz4/lz4#703, do you still suspect an endian-ness issue? |
Hi!
I'm using lz4-rs in my
compressed_log
1 crate to compress log on the fly to a remote server over persistent websocket connection. I noticed that on MIPS 32-bit big endian clients it produces data stream that x86_64 LE server can't decode. This is very interesting as after investigating upstream liblz4 code it seems like they really care about endianness and the binary stream is supposed to be portable.(Which appears to be this line in liblz4 https://github.com/lz4/lz4/blob/591b6621244e77d8293230085ae65db0cfa98d88/lib/lz4frame.c#L1078-L1079)
I'm thinking that it may be the bindings problem, or invalid flags for big endian. After some experiments I've got some data decoded, but at some point it still fails with
ERROR_frameType_unknown
. So my question is - is there anything missing on lz4-rs side, or some issue? I wonder whats your opinion on this matter.I've also checked how Linux distros build liblz4 for big endian architectures but they seem to just use upstream Makefile (the process is very similiar to
build.rs
in lz4-rs)Please refer to my fork https://github.com/mpapierski/lz4-rs/blob/big-endian/lz4-sys/build.rs#L20-L29 for lines that appeared to improve a bit the decoding situation.
The text was updated successfully, but these errors were encountered: