php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26778 memleaks with objects and recursive references
Submitted: 2004-01-03 09:52 UTC Modified: 2004-01-11 10:50 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: r2cosmin at rdstm dot ro Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS OS: *
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: r2cosmin at rdstm dot ro
New email:
PHP Version: OS:

 

 [2004-01-03 09:52 UTC] r2cosmin at rdstm dot ro
Description:
------------
Php craches when trying to serialize objects with deep recursive references. It only works with two objects, each having a reference to the other. When using three or more objects in a circular chain, it crashes badly.

I have written a simplified example for help.

Thanks.

PS.
     I have found this bug ( and bug reports on it ) in the past but it doesn't seem to be fixed. Maybe it has reapered in php5. 

Reproduce code:
---------------
<?
class A
{
	public $b;
}
class B
{
	public $c;
}
class C
{
	public $a;
}
$a = new A();
$b = new B();
$c = new C();
$a->b = $b;
$b->c = $c;
$c->a = $a;
echo serialize($a);
?>

Expected result:
----------------
some serializaton string

Actual result:
--------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, r2cosmin@msn.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


--------------------------------------------------------------------------------

Apache/2.0.45 (Win32) Server at 127.0.0.1 Port 80

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-05 02:43 UTC] helly@php.net
Running in CLI on Win* and *nix there are memleaks but no SEGV. Please try the following patch:
http://marcus-boerger.de/php/ext/ze2/ze2-object_dtor-20040104.diff.txt
 [2004-01-05 15:30 UTC] r2cosmin at rdstm dot ro
The last cvs is working around this bug but unfortunely there seems serialisation has a more nasty bug that is screqing the references. I have subbmitted a bug report on it (id=26790). Thanks for all your help.
 [2004-01-05 16:47 UTC] helly@php.net
The script above has memleaks.
 [2004-01-11 10:50 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. 

Thank you for your interest in PHP.

See bug #26765

 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Dec 04 23:05:52 2022 UTC