|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-08-16 05:27 UTC] 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 ===
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 02:00:01 2025 UTC |
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.