Bug #53858 [Opn]: infinite loop in __tostring() causes seg fault
| From: | scottmac@php.net | Date: | Fri, 28 Jan 2011 09:37:33 +0000 |
| Subject: | Bug #53858 [Opn]: infinite loop in __tostring() causes seg fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158263@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53858&edit=1
ID: 53858
Updated by: scottmac@php.net
Reported by: alok at fb dot com
Summary: infinite loop in __tostring() causes seg fault
Status: Open
Type: Bug
Package: Class/Object related
Operating System: All
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
This is a crash in stock PHP 5.2 too, Our version in APE has a patch
that adds
fb.recursion_max and overrides zend_execute to do the counting.
Previous Comments:
------------------------------------------------------------------------
[2011-01-27 19:01:25] alok at fb dot com
Description:
------------
The following piece of code would cause "PHP Fatal error: [php_fb]:
call depth has exceeded the maximum recursion setting of 500!, eject!
eject! eject!..." in 5.2.5. However, on versions 5.3.3 and 5.3.5, I am
seeing a segmentation fault.
Test script:
---------------
<?php
class A { public function __toString() { (string)$this; } }
(string)new A();
Expected result:
----------------
"PHP Fatal error: [php_fb]: call depth has exceeded the maximum
recursion setting of 500!, eject! eject! eject!..." seems a reasonable
result.
Actual result:
--------------
segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53858&edit=1