Bug #71317 [NEW]: PharData fails to open specific file

From: Date: Sat, 09 Jan 2016 00:25:36 +0000
Subject: Bug #71317 [NEW]: PharData fails to open specific file
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198540@lists.php.net to get a copy of this message
From:             weirdan at gmail dot com
Operating system: Debian/sid
PHP version:      7.0.2
Package:          PHAR related
Bug Type:         Bug
Bug description:PharData fails to open specific file

Description:
------------
There's a tar file that PharData fails to open:
http://download.pear.php.net/package/Structures_Graph-1.1.1.tgz
(either
gzipped or ungzipped).

It works with php 5.3 (vanilla), 5.6 (debian build), but fails starting
with php 7.0.{0,1,2} (all vanilla versions from php.net)

If I repack the archive (unpack and pack it back with tar cvf) it works
fine. At first I thought the cause of the problem was that the archive
did not include directories, but other similar archive (also without
folder entries)
http://download.pear.php.net/package/Console_CommandLine-1.2.1.tgz
opens
just fine.

Test script:
---------------
#!/bin/bash
for ver in 5.3.29 system 7.0.0 7.0.1 7.0.2; do 
  phpenv local $ver
  php -r 'echo phpversion() . "\n"; new
\PharData("bad/Structures_Graph-1.1.1.tar");'
done

Expected result:
----------------
5.3.29
5.6.16-4
7.0.0
7.0.1
7.0.2

Actual result:
--------------
5.3.29
5.6.16-4
7.0.0
PHP Fatal error:  Uncaught UnexpectedValueException: phar error:
tar-based phar "Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot
be registered in Command line code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
  thrown in Command line code on line 1
7.0.1
PHP Fatal error:  Uncaught UnexpectedValueException: phar error:
tar-based phar "Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot
be registered in Command line code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
  thrown in Command line code on line 1
7.0.2
PHP Fatal error:  Uncaught UnexpectedValueException: phar error:
tar-based phar "Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot
be registered in Command line code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
  thrown in Command line code on line 1


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



Thread (8 messages)

« previous php.bugs (#198540) next »