Bug #75102 [NEW]: `PharData` says invalid checksum for valid tar

From: Date: Mon, 21 Aug 2017 16:28:44 +0000
Subject: Bug #75102 [NEW]: `PharData` says invalid checksum for valid tar
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210766@lists.php.net to get a copy of this message
From:             d28b312d at opayq dot com
Operating system: Windows 10 + Cygwin
PHP version:      Irrelevant
Package:          PHAR related
Bug Type:         Bug
Bug description:PharData says invalid checksum for valid tar 

Description:
------------
Found an example of a valid tgz file which is a valid tar file, but
complains about an invalid checksum.

It extracts with tar -xvzf /tmp/foo.tgz and also extracts fine from
7zip.

I have also tried decompressing it before using PharData and it still
fails which means it's not the decompression doing it.

Test script:
---------------
<?php

$download = 'http://thrysoee.dk/editline/libedit-20100424-3.0.tar.gz';
$file = '/tmp/libedit20100424.tgz';

file_put_contents($file, fopen($download, 'r'));
var_dump(new PharData($file));

Expected result:
----------------
To see the PharData object in the console.

Actual result:
--------------
PHP Fatal error:  Uncaught UnexpectedValueException: phar error:
"/tmp/libedit20100424.tgz" is a corrupted tar file (checksum mismatch of
file "libedit-20100424-3.0") in /tmp/phpbugtest2.php:7
Stack trace:
#0 /tmp/phpbugtest2.php(7): PharData->__construct('/tmp/libedit201...')
#1 {main}
  thrown in /tmp/phpbugtest2.php on line 7

-- 
Edit bug report at https://bugs.php.net/bug.php?id=75102&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=75102&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=75102&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=75102&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=75102&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=75102&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=75102&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=75102&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=75102&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=75102&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=75102&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=75102&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=75102&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=75102&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75102&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=75102&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=75102&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=75102&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75102&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=75102&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=75102&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#210766) next »