Bug #70299 [Opn->Csd]: Memleak while assigning object offsetGet result
| From: | laruence@php.net | Date: | Wed, 19 Aug 2015 02:57:13 +0000 |
| Subject: | Bug #70299 [Opn->Csd]: Memleak while assigning object offsetGet result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195321@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70299&edit=1
ID: 70299
Updated by: laruence@php.net
Reported by: laruence@php.net
Summary: Memleak while assigning object offsetGet result
-Status: Open
+Status: Closed
Type: Bug
Package: Scripting Engine problem
PHP Version: 7.0.0beta3
-Assigned To:
+Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2015-08-19 02:51:54] laruence@php.net
Description:
------------
this bug is fixed already by me last night while try to to fix SEND_REF bug #70288
anyway, it's better to have a bug entry for the record
Test script:
---------------
<?php
class MyTree implements ArrayAccess {
public $children = array();
public function offsetExists($offset) {
}
public function offsetUnset($offset) {
}
public function offsetSet($offset, $value) {
$this->children[$offset] = $value;
}
public function offsetGet($offset) {
return $this->children[$offset];
}
}
$root = new MyTree();
$root[0] = new MyTree();
$a = &$root[0];
$b = &$root[0];
$c = &$root[0];
$d = &$root[0];
?>
Expected result:
----------------
non memory leak
Actual result:
--------------
[Wed Aug 19 10:43:57 2015] Script: '/tmp/1.php'
/home/huixinchen/opensource/github/php-src/Zend/zend_objects.c(161) : Freeing 0x7F2E4145A4E0 (56
bytes), script=/tmp/1.php
[Wed Aug 19 10:43:57 2015] Script: '/tmp/1.php'
/home/huixinchen/opensource/github/php-src/Zend/zend_execute.c(543) : Freeing 0x7F2E414730A8 (24
bytes), script=/tmp/1.php
Last leak repeated 3 times
=== Total 5 memory leaks detected ===
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70299&edit=1