ID:               45434
 User updated by:  php at benjaminschulz dot com
 Reported By:      php at benjaminschulz dot com
 Status:           Open
 Bug Type:         Reproducible crash
 Operating System: linux, osx
 PHP Version:      5.3CVS-2008-07-04 (CVS)
 New Comment:

Oops, i missed one important point: the segfault occurs if an exception
is thrown ;) Sorry, it's too late for me today.


Previous Comments:
------------------------------------------------------------------------

[2008-07-04 20:14:21] php at benjaminschulz dot com

Description:
------------
A circular reference causes gc_collect_cycles() to segfault. I know
there is another bug that looks similar (#36482) but i think this is a
far better (because simpler) test case.

Reproduce code:
---------------
<?php
class foo {
    public $foo;

    public function __destruct() {
        throw new Exception("foobar");
    }
}

$f1 = new foo;
$f2 = new foo;
$f1->foo = $f2;
$f2->foo = $f1;
unset($f1, $f2);
// triggers a segfault
gc_collect_cycles();


Actual result:
--------------
$ php test.php 
Segmentation fault


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45434&edit=1

Reply via email to