|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-01-07 15:49 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 22 16:00:01 2025 UTC |
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.