#24184 [Fbk]: PHP crashes/hangs webserver

From: Date: Sat, 14 Jun 2003 16:31:09 +0000
Subject: #24184 [Fbk]: PHP crashes/hangs webserver
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-41900@lists.php.net to get a copy of this message
 ID:               24184
 Updated by:       elmicha@php.net
 Reported By:      blueroom at digitalmente dot net
 Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: Windows 2000
 PHP Version:      4.3.2
 New Comment:

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;
?>





Previous Comments:
------------------------------------------------------------------------

[2003-06-14 10:42:37] helly@php.net

Please try it with exactly 65534, 65535, 65536 and 65537 entries.

------------------------------------------------------------------------

[2003-06-14 10:24:39] 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.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24184&edit=1



Thread (9 messages)

« previous php.bugs (#41900) next »