|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-27 22:13 UTC] tomwys at o2 dot pl
Description:
------------
I have tested this code on two machines. I have memory error or endless loop.
On first machine code fails from $count = 385 on second machine from $count = 1633.
Reproduce code:
---------------
<?php
$count = 385;
for($i = 1; $i < $count; $i ++) {
ob_start();
echo $i;
ob_flush();
}
?>
Expected result:
----------------
123456789101112[etc.]
Actual result:
--------------
First machine:
1[there is endless loop and 100% CPU]
Second machine:
1*** glibc detected *** double free or corruption (top): 0x0000000004c9c370 ***
Aborted
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
I got a segfault with $count = 1633. in 5.2.0 with 5_2 CVS in debug mode I get For exmaple ./sapi/cli/php -dmemory_limit=4M obmess.php 1PHP Fatal error: Allowed memory size of 4194304 bytes exhausted at /home/cristian/php5/main/output.c:436 (tried to allocate 40961 bytes) in /local/back/home/cristian/php5/obmess.php on line 4 [Sun Jan 28 07:49:34 2007] Script: 'obmess.php' --------------------------------------- /home/cristian/php5/main/output.c(316) : Block 0x00EF8FE8 status: Beginning: Cached Freed (invalid) Start: OK End: OK --------------------------------------- [Sun Jan 28 07:49:34 2007] Script: 'obmess.php' --------------------------------------- /home/cristian/php5/main/output.c(319) : Block 0x0102CD58 status: Beginning: Freed Start: OK End: OK<?php set_time_limit(0); $handle = imagecreatefromjpeg('images/large.jpg'); for ($i = 1; $i < 1000; $i++) { ob_start(); imagejpeg($handle, '', 90); $imgdata = ob_get_contents(); ob_end_clean(); } ?> Apache keeps running and PHP gives Fatal error: out of dynamic memory in yy_create_buffer() in Unknown on line 0 with every pageload after so no php pages will load...