Bug #69201 [NEW]: Memory leak using iterator and get by reference on PHP 7

From: Date: Sun, 08 Mar 2015 04:36:43 +0000
Subject: Bug #69201 [NEW]: Memory leak using iterator and get by reference on PHP 7
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191242@lists.php.net to get a copy of this message
From: jrbasso at gmail dot com Operating system: Any PHP version: master-Git-2015-03-08 (Git) Package: SPL related Bug Type: Bug Bug description:Memory leak using iterator and get by reference on PHP 7 Description: ------------ Compiling PHP in debug mode and running the code from http://3v4l.org/pb3a2 shows a memory leak at the end. It doesn't happen on stable versions of PHP 5.6. This get worst when the returned value is a string, as you can see on http://3v4l.org/S3fTZ. If you check the results you will see &string(1747940472) instead of string(11) like the other versions. Depending the functions you use after this you get the warning about the string not-zero terminated. Expected result: ---------------- object(Entity)#1 (1) { ["_properties":protected]=> array(1) { ["foo"]=> string(6) " world" } } Actual result: -------------- object(Entity)#1 (1) { ["_properties":protected]=> array(1) { ["foo"]=> string(6) " world" } } [Sun Mar 8 03:59:48 2015] Script: '/home/vagrant/shared/test2.php' /home/vagrant/shared/php-src/Zend/zend_vm_execute.h(24234) : Freeing 0x7FFAD80751C0 (24 bytes), script=/home/vagrant/shared/test2.php -- Edit bug report at https://bugs.php.net/bug.php?id=69201&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69201&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69201&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69201&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69201&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69201&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69201&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69201&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69201&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69201&r=support Expected behavior: https://bugs.php.net/fix.php?id=69201&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69201&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69201&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69201&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69201&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69201&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69201&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69201&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69201&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69201&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69201&r=mysqlcfg

« previous php.bugs (#191242) next »