From:             e at osterman dot com
Operating system: Redhat
PHP version:      5.1.4
PHP Bug Type:     Class/Object related
Bug description:  Recursive object creation causes segfault

Description:
------------
Sorry if this is a duplicate bug; the words __construct and segfault
appear thousands of times in this bug database.

If you try to construct an object of yourself in the constructor, the
infinite recursion causes a segfault. Ofcourse, you never want to
construct yourself like this, but then again, you never want to segfault
either. 

Reproduce code:
---------------
<?
/*
 * Tested on: 
 * PHP 5.1.4 (cli) (built: May 18 2006 09:50:08)
 * Copyright (c) 1997-2006 The PHP Group
 * Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend  Technologies
 */

class SegFault
{
    public function __construct()
    {
        new SegFault();
    }

}

$breakme = new SegFault();

?>


Expected result:
----------------
PHP Warning: something to the effect of infinite recursion

Actual result:
--------------
Segmentation fault

-- 
Edit bug report at http://bugs.php.net/?id=37976&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37976&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37976&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37976&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37976&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37976&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37976&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37976&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37976&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37976&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37976&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37976&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37976&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37976&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37976&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37976&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37976&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37976&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37976&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37976&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37976&r=mysqlcfg

Reply via email to