|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-24 16:20 UTC] tony2001@php.net
[2005-12-02 01:00 UTC] php-bugs at lists dot php dot net
[2009-09-12 00:46 UTC] linlixiang123 at 126 dot com
[2009-09-25 08:47 UTC] DSHHH at HOTMAIL dot COM
[2010-06-28 09:01 UTC] DAVOGUEMALL at GMAIL dot COM
[2011-08-02 06:10 UTC] junxing dot lin at yahoo dot com
[2011-08-02 06:11 UTC] junxing dot lin at yahoo dot com
[2011-09-04 06:46 UTC] junxing dot lin at yahoo dot com
[2012-06-06 03:34 UTC] councilxvb32 at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Description: ------------ Objects, referencing each other, are serialized. The reference seems to be represented as R:1 in the serialized data. When unserializing the string, it seems (begin of guess) that the reference is not interpreted correctly and countless objects are instantiated instead (end of guess) - the script takes remarkably long and ends with the allowed memory size exhausted. The problem doesn't seem to occur when the unserialized data is simply echoed instead of assigned to a variable, but obviously that's not so useful. The problem still occurs when var_dumping the unserialized data. The problem exists on PHP 5.1.0RC6, but not on PHP 5.0.5. Unfortunately, we cannot install the CVS version just for checking if the problem still exists. We hope you're still willing to at least quickly verify it. Reproduce code: --------------- class A { public $b; } class B { public $a; } $a = new A(); $b = new B(); $a->b = &$b; $b->a = &$a; $x = unserialize(serialize($a)); Expected result: ---------------- $x is a copy of $a, with $x->b being a copy of $b that holds a reference to $x. print_r'd that would look like this: A Object ( [b] => B Object ( [a] => A Object *RECURSION* ) ) Actual result: -------------- Memory exhaustion and sometimes a segmentation fault.