The LZ4 binary performs a correct round-trip when run on the file
containing the data that fails the roundtrip under Perl (see first block).
Best,
Daniel
PS: When compressing the file with the simple attached Perl program
(compress.pl), then it produces a different compressed string than what
is inside the file the lz4 binary produces (see second block) -- is that
to be expected?
Cheers,
Daniel
8<-----------------------------------------------------------------------
q@qew:~/tmp/lz4$ cat test.pl
#!/usr/bin/perl
use Compress::LZ4;
my $in = `cat $0`;
my $dest = decompress(compress($in));
print "=" x 80 ."\n" . $in;
print "=" x 80 ."\n" . $dest;
print "=" x 80 . "\n";
die unless $in eq $dest;
q@qew:~/tmp/lz4$ ./lz4demo64.exe -c test.pl test.pl.compressed
*** Compression CLI using LZ4 algorithm , by Yann Collet (Mar 8 2012) ***
Compressed 199 bytes into 157 bytes ==> 78.89%
Done in 0.00 s ==> inf MB/s
q@qew:~/tmp/lz4$ ./lz4demo64.exe -t test.pl.compressed
*** Compression CLI using LZ4 algorithm , by Yann Collet (Mar 8 2012) ***
Successfully decoded 199 bytes
Done in 0.00 s ==> inf MB/s
q@qew:~/tmp/lz4$ ./lz4demo64.exe -d test.pl.compressed test.pl.roundtrip
*** Compression CLI using LZ4 algorithm , by Yann Collet (Mar 8 2012) ***
Successfully decoded 199 bytes
Done in 0.00 s ==> inf MB/s
q@qew:~/tmp/lz4$ diff test.pl test.pl.roundtrip
q@qew:~/tmp/lz4$
8<-----------------------------------------------------------------------
q@qew:~/tmp/lz4$ ./compress.pl test.pl > test.pl.compressed_Perl
q@qew:~/tmp/lz4$ diff test.pl.compressed test.pl.compressed_Perl
Binary files test.pl.compressed and test.pl.compressed_Perl differ
q@qew:~/tmp/lz4$ ./lz4demo64.exe -t test.pl.compressed_Perl
*** Compression CLI using LZ4 algorithm , by Yann Collet (Mar 8 2012) ***
Unrecognized header : file cannot be decoded
q@qew:~/tmp/lz4$ ls -la test.pl.compressed*
-rw-rw-r-- 1 q q 157 Mar 8 14:27 test.pl.compressed
-rw-rw-r-- 1 q q 168 Mar 8 14:28 test.pl.compressed_Perl
On 03/08/2012 02:16 PM, gray via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=75624 >
>
> On Thu Mar 08 13:58:27 2012, danielqzinn@gmail.com wrote:
>
>> Please find attached an example perl script to reproduce the bug.
>>
>> I am using the current version of Compress::LZ4 from CPAN and the tests
>> that come with it went through fine. More information about my
>> environment is attached.
>>
>> I also attached a .t file that can be used to reproduce the test as part
>> of the distribution.
>
> Please verify that this is not a bug in the lz4 c code:
> svn checkout
http://lz4.googlecode.com/svn/trunk/ lz4
> cd lz4
> make
> ./lz4demo64.exe -c $input_file output
> ./lz4demo64.exe -t output
> ./lz4demo64.exe -d roundtrip $input_file
> diff output roundtrip
>
> ./lz4demo32.exe -c $input_file output
> ./lz4demo32.exe -t output
> ./lz4demo32.exe -d roundtrip $input_file
> diff output roundtrip
>
> If anything above fails, it's a problem with the c code and you should
> report it to that project. If the above succeeded, then I'm not sure
> what the problem is.