Bug #62989 [Com]: recursive __call cause segfault
| From: | gmblar+php at gmail dot com | Date: | Sat, 01 Sep 2012 15:21:12 +0000 |
| Subject: | Bug #62989 [Com]: recursive __call cause segfault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173090@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62989&edit=1
ID: 62989
Comment by: gmblar+php at gmail dot com
Reported by: gmblar+php at gmail dot com
Summary: recursive __call cause segfault
Status: Not a bug
Type: Bug
Package: Class/Object related
Operating System: MacOSX
PHP Version: 5.4.6
Block user comment: N
Private report: N
New Comment:
I expect the same from __call as from a normal method which abort with a fatal
error.
<?php
class foo {
public function bar() {
$this->bar();
}
}
$foo = new foo();
$foo->bar();
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 130968 bytes) in - on line 5
Previous Comments:
------------------------------------------------------------------------
[2012-09-01 14:45:17] felipe@php.net
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
It's expected, due the call stack overflow.
------------------------------------------------------------------------
[2012-09-01 12:42:36] gmblar+php at gmail dot com
Description:
------------
recursive __call cause segfault
Test script:
---------------
<?php
class foo {
public function __call($method, $arguments) {
$this->bar();
}
}
$foo = new foo();
$foo->bar();
Expected result:
----------------
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 130968 bytes) in - on line 6
Actual result:
--------------
Segmentation fault: 11
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62989&edit=1