php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6941 References are not maintained through sessions
Submitted: 2000-09-29 12:39 UTC Modified: 2000-09-30 02:56 UTC
From: robert dot hartman at eyeo dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.2 OS: Linux/i586
Private report: No CVE-ID: None
 [2000-09-29 12:39 UTC] robert dot hartman at eyeo dot com
PHP causes httpd to segfault with the following scripts.  Basically,
we feel that when the objects get restored at session_start the
references are no longer valid.

Apache Error Log:
[Thu Sep 28 19:55:57 2000] [notice] child pid 255 exit signal Segmentation fault (11)

=== file 1 ===

<?
class parentClass {
        var $child;
        var $relation = "mother";

        function makeChild() {
                $this->child = new ChildClass($this);
        }
}

class childClass {
        var $parentLink;

        function childClass(&$parent) {
                $this->parentLink = &$parent;
        }
}

session_start();
session_register("mom");

$mom = new parentClass;
$mom->makeChild();
?>

<html>
<?
echo $mom->child->parentLink->relation . "<br>";
?>
<a href="next.phtml">next</a>
</html>


=== file 2 ===


<?
class parentClass {
        var $relation = "mother";
}

class childClass {
        var $parentLink;

        function childClass(&$parent) {
                $this->parentLink = &$parent;
        }
}

session_start();
session_register("mom");

?>

<html>
<?
echo $son->parentLink->relation . "<br>";
?>
<a href="next.phtml">next</a>
</html>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-30 02:56 UTC] sas@php.net
PHP does not segfault anymore when trying to serialize circular references.

Note however that the serializer won't support serializing references anytime soon. If you think you cannot live without that, feel free to post a feature request.

Thanks for reporting this issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 11:01:31 2024 UTC