Bug #69323 [NEW]: PHP Fatal error: Uncaught exception 'PharException' with message 'unable to se
| From: | nazar at mokrynskyi dot com | Date: | Sat, 28 Mar 2015 23:08:57 +0000 |
| Subject: | Bug #69323 [NEW]: PHP Fatal error: Uncaught exception 'PharException' with message 'unable to se | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-191671@lists.php.net to get a copy of this message | ||
From: nazar at mokrynskyi dot com
Operating system: Ubuntu x64
PHP version: 5.6.7
Package: PHAR related
Bug Type: Bug
Bug description:PHP Fatal error: Uncaught exception 'PharException' with message
'unable to se
Description:
------------
Test script is very simple, but when I run it - I get:
> PHP Fatal error: Uncaught exception 'PharException' with message
'unable to seek to start of file
Note, that if we add one file (no matter the same or different) - it
works fine, it two (no matter the same or different) - it crashes with
exception.
My thoughts are that after unsetting $phar, file is not properly closed
and there is some uncleaned cache present.
I can send pull request with this test case added on GitHub.
Test script:
---------------
<?php
ini_set('display_errors', 1);
file_put_contents('test', 'some content');
$phar = new Phar('build.phar');
$phar->addFile('test', 'test');
$phar->addFile('test', 'test2');
unset($phar);
rename('build.phar', 'build2.phar');
$phar = new Phar('build.phar');
$phar->addFile('test', 'test');
echo "ok";
Expected result:
----------------
ok
Actual result:
--------------
Fatal error: Uncaught exception 'PharException' with message 'unable to
seek to start of file "test2" while creating new phar
"/path/build.phar"' in /path/build.php:10 Stack trace: #0
/path/build.php(10): Phar->addFile('test', 'test') #1 {main} thrown in
/path/build.php on line 10
--
Edit bug report at https://bugs.php.net/bug.php?id=69323&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69323&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69323&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69323&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69323&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69323&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69323&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69323&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69323&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69323&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69323&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69323&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69323&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69323&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69323&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69323&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69323&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69323&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69323&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69323&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69323&r=mysqlcfg