|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-06-14 10:24 UTC] blueroom at digitalmente dot net
Description:
------------
PHP crashes/hangs webserver for unkown reason (hitting a memory limit?)
Reproduce code:
---------------
/*
This problem was accidentaly found when trying to
find the fastest method of filling up an array (using [], array_push, etcetera). When lowering the number of objects in the array (60000, 50000), the crash doesn't occur.
*/
class object {
var $var1;
var $var2;
var $var3;
function object() {
$var1= 'blah';
$var2= 'bleh';
$var3= 'blih';
}
}
$object= new object;
for($index= 0; $index<70000; $index++) $array[]= $object;
Expected result:
----------------
Well, I'd expect it not to crash :)
Actual result:
--------------
When using Apache, you get a "apache.exe has generated errors blablabla error" for the current request. Apache still functions for any other subsequent requests.
When using IIS, it simply hangs dead, not returning any data.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 10:00:01 2025 UTC |
Here on Linux, it's fine with $index<65535, but with $index<65536, I get: [Sat Jun 14 18:27:36 2003] Script: '/home/elmicha/php/bug24184.php' --------------------------------------- /usr/local/src/php-4.3.2/Zend/zend_execute.h(44) : Block 0x084E4298 status: Beginning: Overrun (magic=0x084D9D88, expected=0x7312F8DC) End: Unknown --------------------------------------- No core dump, though. The same happens without a class involved: <?php $no_object = "abc"; for($index= 0; $index<65536; $index++) $array[] = $no_object; ?> No problems here with: <?php for($index= 0; $index<65536; $index++) $array[] = "abc"; ?> And no problems with: <?php for($index= 0; $index<65536; $index++) $array[] = $index; ?>