Bug #71504 [NEW]: Parsing of tar file with duplicate filenames causes memory leak
From: zawadi at gmail dot com
Operating system: ubuntu
PHP version: 5.6.18RC1
Package: PHAR related
Bug Type: Bug
Bug description:Parsing of tar file with duplicate filenames causes memory leak
Description:
------------
When parsing a tar file with duplicate filenames there is a memoryleak
when registering subsequent filenames.
This is actually the same bug as has been reported
https://bugs.php.net/bug.php?id=71317
attached is a patch against the php 5.6 codebase
use this file in conjunction with the attached testcase
http://download.pear.php.net/package/HTML_CSS-1.5.4.tgz
Test script:
---------------
--TEST--
Bug #71317: duplicate filenames in tar file cause memory leak
--SKIPIF--
<?php if (!extension_loaded('phar')) die('skip'); ?>
<?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
<?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
--FILE--
<?php
$fname = str_replace('\\', '/', dirname(__FILE__) .
'/files/HTML_CSS-1.5.4.tgz');
try {
$tar = new PharData($fname);
} catch(Exception $e) {
echo $e->getMessage() . "\n";
}
?>
===DONE===
--EXPECT--
===DONE===
Expected result:
----------------
when running with ENABLE_MAINTAINER_ZTS=1 enabled the test should report
a memoryleak.
--
Edit bug report at https://bugs.php.net/bug.php?id=71504&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71504&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71504&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71504&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71504&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71504&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71504&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71504&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71504&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71504&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71504&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71504&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71504&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71504&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71504&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71504&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71504&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71504&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71504&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71504&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71504&r=mysqlcfg
Thread (2 messages)
- zawadi at gmail dot com