ID: 16149
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Analyzed
Bug Type: Scripting Engine problem
Operating System: ANY
PHP Version: 4.2.1-dev
New Comment:
Yasuo - what you're seeing is not a leak, but a crash report (it tried
to free a block which was already freed). Lots of these double frees
are caught by the cache and in debug mode, they are displayed.
Vincent - there's no immediate solution to the problem, other than
avoiding the use of the same value more than 64K times. Do you really
have to assign $file to that many places?
If you really do, you can edit Zend/zend.h, look for the line:
zend_ushort refcount;
change it to:
uint refcount;
And recompile (make clean; make)
Previous Comments:
------------------------------------------------------------------------
[2002-03-19 11:07:24] [EMAIL PROTECTED]
we are using lots of arrays in php and have to roll back to 4.0.6 as
some of our script won't work on 4.1.2.
i am not a php core developer, can you provide us further information
regarding the refcount problem?
------------------------------------------------------------------------
[2002-03-19 04:36:19] [EMAIL PROTECTED]
This must be refcount limitation.
I see memory leak with 4.2.1-dev and 4.2.0-dev.
Scripting engine problem.
This problem may be suspended. It's not simple to fix.
May be we should let PHP die if refcount reached it's limit.
[yohgaki@dev HEAD]$ ./sapi/cli/php
<?php
$file = "-----";
for ($i = 0; $i<9000 ; $i++) {
$result_array["one"][$i] = $file;
$result_array["two"][$i] = $file;
$result_array["three"][$i] = $file;
$result_array["four"][$i] = $file;
$result_array["five"][$i] = $file;
$result_array["six"][$i] = $file;
$result_array["seven"][$i] = $file;
$result_array["eight"][$i] = $file;
}
echo "done<BR>";
?>
done<BR>
[Tue Mar 19 18:41:50 2002] Script: '-'
---------------------------------------
/home/yohgaki/cvs/php/HEAD/Zend/zend_execute.h(62) : Block 0x082AC068
status:
Beginning: Cached (allocated on
/home/yohgaki/cvs/php/HEAD/Zend/zend_execute.c:467, 12 bytes)
End: OK
---------------------------------------
[yohgaki@dev HEAD]$ ./sapi/cli/php -v
4.2.1-dev
[yohgaki@dev HEAD]$
------------------------------------------------------------------------
[2002-03-19 04:22:35] [EMAIL PROTECTED]
To properly diagnose this bug, we need a backtrace to see what is
happening behind the scenes. To find out how to generate a backtrace,
please read http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open".
------------------------------------------------------------------------
[2002-03-18 13:13:50] [EMAIL PROTECTED]
try the follow code, it works on 4.0.6 but "Segmentation fault (core
dumped)" on CGI version and give no error message (and appear to keep
executing the code few more times on other httpd child process too) on
dynamic apache module version.
i've memory limited to 8M, and it's fine when for lopp as "$i<8000".
<?php
$file = "-----";
for ($i = 0; $i<9000 ; $i++) {
$result_array["one"][$i] = $file;
$result_array["two"][$i] = $file;
$result_array["three"][$i] = $file;
$result_array["four"][$i] = $file;
$result_array["five"][$i] = $file;
$result_array["six"][$i] = $file;
$result_array["seven"][$i] = $file;
$result_array["eight"][$i] = $file;
}
echo "done<BR>";
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16149&edit=1