php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11432 crash when restoring references to objects
Submitted: 2001-06-12 08:29 UTC Modified: 2001-06-20 11:17 UTC
From: zork at pablosoft dot com dot pl Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.5 OS: Linux 2.2.16
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: zork at pablosoft dot com dot pl
New email:
PHP Version: OS:

 

 [2001-06-12 08:29 UTC] zork at pablosoft dot com dot pl
Here are two scripts that operates on referenced objects. make.php creates object $b with reference to object $a as argument.

After serialize/unserialize show.php checks if the reference still exists.

PHP 4.0.1pl1 lost references.
PHP 4.0.4pl1 segfaults on show.php
PHP 4.0.5    segfaults on show.php and(!) sometimes on make.php

Config line:
./configure --with-pgsql=shared --with-apxs --sysconfdir=/etc --prefix=/usr \
--localstatedir =/var --with-config-file-path=/etc/httpd/conf/ \
--with-gettext=/usr/share/gettext

make.php:
<?
class ClassA {
 var $arg_a;
};

class ClassB {
 	var $arg_b;
 
 	function ClassB(&$a) {
		$this -> arg_b = &$a;
	}
};

session_start();
session_destroy();
session_register("b");
session_register("a");

$a = new ClassA();
$a -> arg_a = 4;
$b = new ClassB($a);
echo "done. Click <a href=\"show.php\">here</a>";
?>


show.php:
<?
class ClassA {
 var $arg_a;
};

class ClassB {
 	var $arg_b;
 
 	function ClassB(&$a) {
		$this -> arg_b = &$a;
	}
};

session_start();
$a -> arg_a = 6;
echo $b -> arg_b -> arg_a;
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-12 13:40 UTC] sniper@php.net
reproduced with 4.0.6RC3

 [2001-06-15 06:59 UTC] zeev@php.net
Reclassifying (I don't think it can be reproduced with 'pure scripting' alone, so it's probably a session module bug
 [2001-06-19 11:21 UTC] zork at pablosoft dot com dot pl
I think this bug is strictly related to bug #8676.

I didn't look close enough to all open bugs wher reporting this one. I'll test new CVS when #8676 will be closed. 
 [2001-06-20 09:51 UTC] sniper@php.net
Let's make this duplicate then. ( #8676 )

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 01:01:30 2025 UTC