php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15385 Nested Objects in session crash Both Apache and IIS
Submitted: 2002-02-05 06:59 UTC Modified: 2003-02-25 02:01 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dastolfo at smart dot it
New email:
PHP Version: OS:

 

 [2002-02-05 06:59 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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-15 07:45 UTC] michal dot matula at billboard dot cz
Hi, 

don't know whether it is related but he have a similar problem. We inicialize a lot of objects with other nested objects in them. After some number of objects inicialized is reached, the apache child process crashes with Apache(Linux): child pid xxxxx exit signal Segmentation fault.

It has definitely something to do with objects, their creation or cleanup as unsetting the object does not help, but not creating the nested objects does.
 [2002-03-06 02:59 UTC] yohgaki@php.net
This problem is very difficult to solve.

Session module does not support referenced object, but
we should not let PHP crash.

I set status to Suspended since I cannot think of good resolution for this bug.
Feel free to set back to Analyzed if anyone find resolution :)
 [2002-04-24 19:25 UTC] yohgaki@php.net
Make this one a dup. of 13236
 [2003-02-25 02:01 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

see bug #13236


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 14:01:31 2024 UTC