#38469 [Asn->Csd]: json tests failed, leaks memory
| From: | dmitry@php.net | Date: | Fri, 28 Dec 2007 13:38:49 +0000 |
| Subject: | #38469 [Asn->Csd]: json tests failed, leaks memory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-120900@lists.php.net to get a copy of this message | ||
ID: 38469
Updated by: dmitry@php.net
Reported By: judas dot iscariote at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5.2.0RC1
Assigned To: dmitry
New Comment:
This bug has been fixed in CVS.
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/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-09-13 13:37:25] dmitry@php.net
ext/json/tests/003.php is not really the problem. It just uses circular
data structure and leaks are expected.
The real problem that the following code creates broken circular data
structure. It shouldn't create circular data ctructure at all.
Reproduce code:
---------------
<?php
$a = array();
$a[] = $a;
var_dump($a);
?>
Expected result:
----------------
array(1) {
[0]=>
array(0) {
}
}
Actual result:
--------------
array(1) {
[0]=>
array(1) {
[0]=>
*RECURSION*
}
}
[Wed Sep 13 17:31:32 2006] Script: '-'
/home/dmitry/php/php5.2/Zend/zend_execute.c(838) : Freeing 0xB7F4FFF0
(16 bytes), script=-
[Wed Sep 13 17:31:32 2006] Script: '-'
/home/dmitry/php/php5.2/Zend/zend_vm_execute.h(18054) : Freeing
0xB7F50A60 (44 bytes), script=-
/home/dmitry/php/php5.2/Zend/zend_API.c(819) : Actual location
(location was relayed)
Last leak repeated 1 time
[Wed Sep 13 17:31:32 2006] Script: '-'
/home/dmitry/php/php5.2/Zend/zend_execute.c(1079) : Freeing 0xB7F50AF4
(35 bytes), script=-
/home/dmitry/php/php5.2/Zend/zend_hash.c(383) : Actual location
(location was relayed)
=== Total 4 memory leaks detected ===
The reason of this bug is IS_CV variables that changed default order of
operand fetches.
------------------------------------------------------------------------
[2006-08-16 05:27:56] judas dot iscariote at gmail dot com
Description:
------------
Hi: the json extension test suite fails, because PHP leaks memory in
ext/json/tests/003.php
ext/json/tests/005.php
ps: ext/pdo/tests/bug_38394.phpt also fails.
Reproduce code:
---------------
tests json 003 and 005.
Expected result:
----------------
no memory leaks
Actual result:
--------------
013+ /local/local/bodegon/php-debug/Zend/zend_execute.c(838) : Freeing
0x2B57DCDB9C18 (24 bytes), script=/local/local/bo
degon/php-debug/ext/json/tests/005.php^M
147 014+ [Wed Aug 16 01:23:03 2006] Script:
'/local/local/bodegon/php-debug/ext/json/tests/005.php'^M
148 015+ /local/local/bodegon/php-debug/Zend/zend_vm_execute.h(18188) :
Freeing 0x2B57DCDBB168 (72 bytes), script=/local/loc
al/bodegon/php-debug/ext/json/tests/005.php^M
149 016+ /local/local/bodegon/php-debug/Zend/zend_API.c(819) : Actual
location (location was relayed)^M 150 017+ Last
leak repeated 1 time^M
151 018+ [Wed Aug 16 01:23:03 2006] Script:
'/local/local/bodegon/php-debug/ext/json/tests/005.php'^M
152 019+ /local/local/bodegon/php-debug/Zend/zend_execute.c(1079) :
Freeing 0x2B57DCDBB318 (71 bytes), script=/local/local/b
odegon/php-debug/ext/json/tests/005.php^M
153 020+ /local/local/bodegon/php-debug/Zend/zend_hash.c(383) : Actual
location (location was relayed)^M 154 021+ === Total
4 memory leaks detected ===
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38469&edit=1