Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0

Bug #19289 Invalid tar file generated
Submitted: 2012-02-13 11:38 UTC
From: slusarz Assigned: mrook
Status: Closed Package: Archive_Tar (version 1.3.8)
PHP Version: 5.3.10 OS: Linux
Roadmaps: 1.3.9    
Subscription  


 [2012-02-13 11:38 UTC] slusarz (Michael Slusarz)
Description: ------------ Discovered when packaging a PEAR release for the Horde project... the tgz file was created but attempting to decompress the file would give the error "tar: A lone zero block at #". Test script to reproduce is below. Test script: --------------- @unlink('test1.txt'); file_put_contents('test1.txt', 'a'); @unlink('test2.txt'); file_put_contents('test2.txt', 'b'); require_once 'Archive/Tar.php'; @unlink('test.tgz'); $a = new Archive_Tar('test.tgz', 'gz'); $a->createModify(array('test1.txt'), ''); $a->addModify(array('test2.txt'), ''); Expected result: ---------------- After running test script, test.tgz file is created. Attempting to untar, this is the output: slusarz@bigworm % tar zxvf test.tgz test2.txt tar: A lone zero block at 3 Actual result: -------------- Verified that adding the '-i' option to tar (--ignore zeros) fixes decompression: slusarz@bigworm % tar zxvfi test.tgz test1.txt test2.txt

Comments

 [2012-02-16 23:41 UTC] mrook (Michiel Rook)
Can you please verify the installed version of Archive_Tar? Using your test script I can't reproduce the error. Also, a similar bug was reported and fixed (#5452).
 [2012-02-17 01:24 UTC] slusarz (Michael Slusarz)
slusarz@bigworm % pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.8 stable slusarz@bigworm % pear list Archive_Tar Installed Files For Archive_Tar =============================== Type Install Path php /httpd/lib/php/pear/Archive/Tar.php doc /httpd/lib/php/pear/doc/Archive_Tar/docs/Archive_Tar.txt Can verify this is the only copy of Archive_Tar on the system: slusarz@bigworm % locate Archive/Tar /httpd/lib/php/pear/Archive/Tar.php /usr/share/perl5/core_perl/Archive/Tar /usr/share/perl5/core_perl/Archive/Tar.pm /usr/share/perl5/core_perl/Archive/Tar/Constant.pm /usr/share/perl5/core_perl/Archive/Tar/File.pm I will try rebuilding PHP from scratch (make distclean) to see if that helps.... Nope, still broken. (and installation of PHP guarantees that the latest version of Archive_Tar is installed). I will attach the output from my example script.
 [2012-02-17 01:27 UTC] slusarz (Michael Slusarz)
Looks like there is no way of attaching a file, so here's a link: http://www.curecanti.org/data/test.tgz
 [2012-02-17 03:00 UTC] mrook (Michiel Rook)
Strange... it seems in your file a lone zero block (512 bytes) is inserted just before test2.txt, after the block containing test1.txt. I'll try & reproduce this but it's going to be tricky.
 [2012-02-23 15:59 UTC] derick (Derick Rethans)
This also affects "pear package". Broken packages are: pecl/mongo-1.2.8 pecl/pecl_http-1.7.2 pecl/pecl_httpd-2.0.0dev5
 [2012-02-23 15:59 UTC] cweiske (Christian Weiske)
The problem also happens on pecl packages: $ wget http://pecl.php.net/get/mongo-1.2.8.tgz $ LC_ALL=C tar -ztvf mongo-1.2.8.tgz -rw-r--r-- derick/derick 23107 2012-02-22 17:55 package.xml tar: A lone zero block at 48 Same with pecl_http-1.7.2
 [2012-02-23 17:33 UTC] derick (Derick Rethans)
Good news. I found the bug. Attaching a patch. Can you please make a bug fix release of this ASAP?
 [2012-02-23 17:35 UTC] derick (Derick Rethans)
 [2012-02-23 19:11 UTC] johannes (Johannes Schlüter)
Ideally we'd have an updated PEAR package before building 5.4.0. :-)
 [2012-02-24 21:25 UTC] mrook (Michiel Rook)
-Roadmap Versions: +Roadmap Versions: 1.3.9
Thanks for the patch, pushing this out ASAP.
 [2012-02-24 21:29 UTC] mrook (Michiel Rook)
-Status: Open +Status: Closed -Assigned To: +Assigned To: mrook
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.