#8471 [Com]: Crash on infinite recursive calls.
| From: | swright at everestgt dot com | Date: | Thu, 01 Jan 2004 04:16:08 +0000 |
| Subject: | #8471 [Com]: Crash on infinite recursive calls. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-52648@lists.php.net to get a copy of this message | ||
ID: 8471
Comment by: swright at everestgt dot com
Reported By: vgo at nrd dot lt
Status: Wont fix
Bug Type: Reproducible crash
Operating System: Windows 2000
PHP Version: 4.0.4
New Comment:
Is there a limit on the number of recursive loops one can have? I did
a sample test script that looped only 10000 times and it crashs after
~753 loops. It crashes PHP.exe (win2k) running it at command line or
under apache.
I do not always get an error. One I did get was "FATAL: erealloc():
Unable to allocate 15 bytes".
Thanks,
Stan
swright@everestgt.com
-------------------------------------------------
<?php
function recursive1( $z ) {
if ( $z > 10000 ) {
return(10);
}
else {
print "<p> recursing $z </p>";
$z++;
return( recursive1( $z ) );
}
}
$x = 1 ;
print recursive1($x) ;
?>
Previous Comments:
------------------------------------------------------------------------
[2002-08-23 06:56:18] sniper@php.net
never ever..
------------------------------------------------------------------------
[2000-12-29 19:17:40] derick@php.net
Chanching to suspended on Jani's request
------------------------------------------------------------------------
[2000-12-29 18:58:53] derick@php.net
PHP does not do infinite recursions, and there is no way to
protect or check for this without making things much slower.
------------------------------------------------------------------------
[2000-12-29 01:56:11] vgo at nrd dot lt
General configuration:
WEB server Apache 1.3.14
php 4.0.4 running as the module for Apache.
The infinite recursive call causes Unknown softaware exception
(0xc00000fd) in Apache.exe
Example:
function checkIfLoggedIn()
{
checkIfLoggedIn();
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=8471&edit=1