php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22231 PHP makes Apache crash
Submitted: 2003-02-15 08:39 UTC Modified: 2003-02-24 10:01 UTC
From: henrik dot gebauer at web dot de Assigned:
Status: Closed Package: Class/Object related
PHP Version: 4.3.0 / 4CVS-2002-02-16 / 5CVS-2002-02-16 OS: Windows 2000 / Linux
Private report: No CVE-ID: None
 [2003-02-15 08:39 UTC] henrik dot gebauer at web dot de
The following script causes my Apache 2.0.43 to crash.
It is repoducable.

PHP 4.3.0 runs as an module.

<?php

class foo {
    var $test = 'test';
    function bar() 
    {
        echo $this->test;
    }
}

function &getFoo() 
{
    $GLOBALS['foo'] =& new foo();
    return $GLOBALS['foo'];
}

$foo =& getFoo();
$foo->bar();

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-15 09:01 UTC] moriyoshi@php.net
Verified with HEAD / PHP_4_3 branch.

The following script causes segfault under php-4.2.3, php-4.3.0, php-5.0.0dev.

<?php
class foo {
    var $fubar = 'fubar';
}

function &foo(){
    $GLOBALS['foo'] = &new foo();
    return $GLOBALS['foo'];
}
$foo = &foo();
var_dump($foo);
var_dump($foo->fubar);
unset($foo);
$foo = &foo();
var_dump($foo->fubar);
?>

 [2003-02-15 10:22 UTC] sniper@php.net
I can NOT reproduce this, with either of the scripts..
(It doesn't _crash_ with CLI at least)

 [2003-02-15 11:17 UTC] moriyoshi@php.net
This bug has something to do with the bug #21600.

http://news.php.net/article.php?group=php.dev&article=93392
 [2003-02-15 12:49 UTC] iliaa@php.net
It seems to me like the user is creating a circular reference, which should not be done. But, using the latest PHP 5.0/4.3.1 I cannot replicate the crash.
 [2003-02-15 13:11 UTC] moriyoshi@php.net
> It seems to me like the user is creating a circular
> reference, which should not be done. But, using the
> latest PHP 5.0/4.3.1 I cannot replicate the crash.

Should it be avoided? I've never heard anything like that.
And if so, this problem should be marked as a documentation problem.

 [2003-02-16 13:19 UTC] zeev@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

(Zend Engine 2)
 [2003-02-24 10:01 UTC] sniper@php.net
Fix will be in PHP 5.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC