pradeep250677 / lz4

Automatically exported from code.google.com/p/lz4
0 stars 0 forks source link

Commandline lz4 stops when decompressing a concatenated lz4 file representing an empty file #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When decompressing the concatenation of several lz4 files, the "lz4 -d" command 
stops decompression after it encounters an lz4 file that represents an empty 
data file.  This causes the output to be truncated compared to what it should 
be.

Here's an illustration, with two initial files that have been compressed.

% echo -n > empty
% echo hi > nonempty
% ls -l empty nonempty
-rw-r--r-- 1 brenocon faculty 0 Oct 20 11:29 empty
-rw-r--r-- 1 brenocon faculty 3 Oct 20 11:29 nonempty

% lz4 -z < empty > empty.lz4      
% lz4 -z < nonempty > nonempty.lz4
% ls -l *.lz4
-rw-r--r-- 1 brenocon faculty 15 Oct 20 11:29 empty.lz4
-rw-r--r-- 1 brenocon faculty 22 Oct 20 11:29 nonempty.lz4

Concatenating two nonempty files works correctly:

% cat nonempty.lz4 nonempty.lz4 | lz4 -d | cat
hi
hi

But this is truncated!  "lz4 -d" quit after the empty file.

% cat nonempty.lz4 empty.lz4 nonempty.lz4 | lz4 -d | cat
hi

Original issue reported on code.google.com by brenocon@gmail.com on 20 Oct 2014 at 3:57

GoogleCodeExporter commented 8 years ago
Oh, the version I'm using seems to be SVN rev 114.  Specifically, Ubuntu 
packages liblz4-tool version 0.0~r114-2ubuntu1.  (I couldn't find a flag for 
the lz4 commandline to report the version number.)

Original comment by brenocon@gmail.com on 20 Oct 2014 at 4:01

GoogleCodeExporter commented 8 years ago
Thanks for the very detailed bug description.
I'll look into it.

Original comment by yann.col...@gmail.com on 20 Oct 2014 at 4:02

GoogleCodeExporter commented 8 years ago
A proposed fixed has been uploaded into the "dev" branch on github :

https://github.com/Cyan4973/lz4/tree/dev

It also adds a new test to check this situation.
Thanks for reporting the issue !

Original comment by yann.col...@gmail.com on 4 Nov 2014 at 11:13

GoogleCodeExporter commented 8 years ago
Fixed into r124

Original comment by yann.col...@gmail.com on 8 Nov 2014 at 8:44