ID:               43187
 Updated by:       [EMAIL PROTECTED]
 Reported By:      thuejk at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Reproducible crash
 Operating System: Linux
 PHP Version:      5.2.4
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is a known recursion limit.


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

[2007-11-04 20:06:37] thuejk at gmail dot com

Description:
------------
When running a recursive loop with lots of iterations, PHP will
segfault.

This will usually be a problem when you write buggy code by accident,
but I guess it is possible to imagine sane programs which uses lots of
recursive calls.

In any case, it is somewhat hard to debug the crash when it happens,
because you do not get an error message when running it in a browser.

Reproduce code:
---------------
<?php

$i=0;
function f() {
  global $i;
  printf("%d\n", $i++);
  f();
}

f();
?>


Expected result:
----------------
(Ignoring the fact that the posted function is tail recursive, and
therefore could be rewritten as a non-recursive loop)

PHP should emit an E_ERROR before it runs out of space. Preferably also
an E_RECOVERABLE_ERROR or E_WARNING a little before it really runs out
of space.

Actual result:
--------------
$ php test.php
1
2
3
[...]
29066
29067
zsh: segmentation fault  php test.php



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


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

Reply via email to