php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15386 Nested Objects in session crash Both Apache and IIS
Submitted: 2002-02-05 07:06 UTC Modified: 2002-02-05 07:13 UTC
From: dastolfo at smart dot it Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.1.1 OS: Linux & Win2K
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dastolfo at smart dot it
New email:
PHP Version: OS:

 

 [2002-02-05 07:06 UTC] dastolfo at smart dot it
Operating Systems: - Linux (with Apache)
                   - Win2k (with both Apache and IIS)

I have a script with two object, one that has the reference to the other. Once the objects are initialized I put them in session before the parent and then the child.

If I reload the page, accessing the child object and modifying a property, after 2-3 times I receive a server error on php module.

On IIS:           ACCESS VIOLATION XXXXXX
On Apache(Linux): child pid xxxxx exit signal Segmentation fault

If I invert the two session_register (registering before the child object and then the parent), it all works perfectly.

<?
class Nephew  {
	var $name = "-";
}


class Family {
	var $nephew = null; 

    function setNephew(&$n) {
    	$this->nephew = &$n;
    }

    function toString() {
        if($this->nephew) {
	    	echo "The nephews are " . $this->nephew->name."<br>";
        }
        else {
	        echo "No nephews<br>";
        }
    }
}

session_start();

if(!isset($family)) {
	$family = new Family();
	$nephew = new Nephew();
	$family->setNephew(&$nephew);

        session_register('family');
        session_register('nephew');
}

$nephew->name .= " - ";
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-05 07:10 UTC] derick@php.net
Submitted twice
 [2002-02-05 07:10 UTC] lobbin@php.net
Submit only once.
 [2002-02-05 07:13 UTC] derick@php.net
Only set it it to bogus once, otherwise we would need a duplicate bogus request bug state :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 15:01:31 2025 UTC