Edit report at https://bugs.php.net/bug.php?id=60682&edit=1
ID: 60682
User updated by: charlie at charliesomerville dot com
Reported by: charlie at charliesomerville dot com
Summary: Infinite recursion through call_user_func causes
segmentation fault
Status: Bogus
Type: Bug
Package: Reproducible crash
Operating System: Irrelevant
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
I believe a segmentation fault due to a VM stack overflow is *definitely* a
bug.
You'd be hard-pressed to find another managed language where user code that
recurses too deep actually crashes the VM.
PHP manages to handle stack overflows just fine in other situations anyway:
function f() { f(); }
function f() { $a = "f"; $a(); }
Neither of those functions will crash the interpreter when called.
Previous Comments:
------------------------------------------------------------------------
[2012-01-09 04:26:44] [email protected]
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
reason is stack overflow, not php issues, but fyi, you can install xdebug to
prevent this.
------------------------------------------------------------------------
[2012-01-07 15:49:55] charlie at charliesomerville dot com
Description:
------------
The PHP interpreter crashes when a call_user_func recurses too deep, rather
than
dying with a memory error.
Test script:
---------------
<?php
function f() { call_user_func("f"); }
f();
Expected result:
----------------
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate
523800 bytes) in /Users/charlie/crap/notsegfault.php on line 4
Actual result:
--------------
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60682&edit=1