#31313 [Fbk->Opn]: $this reference is bad during __wakeup
| From: | bugs dot php dot net at future dot shiny dot co dot il | Date: | Thu, 20 Jan 2005 13:50:27 +0000 |
| Subject: | #31313 [Fbk->Opn]: $this reference is bad during __wakeup | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72515@lists.php.net to get a copy of this message | ||
ID: 31313
User updated by: bugs dot php dot net at future dot shiny dot co dot il
Reported By: bugs dot php dot net at future dot shiny dot co dot il
-Status: Feedback
+Status: Open
Bug Type: Scripting Engine problem
-Operating System: FreeBSD
+Operating System: Linux
PHP Version: 4.3.10
New Comment:
Yes, I can reproduce this with the latest snapshot.
No, despite all my attempts, I wasn't able to produce a minimized
testcase.
Even if I take the session file and run it through unserialize in the
same environment, I cannot reproduce this.
However, I *can* reliably reproduce this bug in my own environment.
From this, I realize that the only solution is for me to debug it
myself. I serialize an object, which has a member object. If, during
wakeup, I replace that member object (with assignment '=') with another
variable of type Object (ANY variable, as long as its type Object), I'd
be replacing some other unrelated member variable -- and the variable
I'd be trying to replace will remain the same. Any hints at debugging
this?
Previous Comments:
------------------------------------------------------------------------
[2005-01-17 18:42:15] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
And if you can reproduce it, please come up with simple test case.
------------------------------------------------------------------------
[2004-12-27 18:19:11] bugs dot php dot net at future dot shiny dot co
dot il
Description:
------------
This is a re-open of Bug #13968.
I can still see the same issue happening with PHP 4.3.10. Just like the
previous poster (in bug #13968), I cannot reproduce this with simple
code. However, the general idea is this:
class Base
{
var $resource = new Resource();
function __wakeup()
{
// In a saved session, the resource lost relevance, so we reopne
it:
$this->resource = open_resource(); // <-- this corrupts Thing's
another_member
}
};
class Child extends Base
{
};
class Thing
{
var $member;
var $another_member; // <-- when wakes up, this is equal to the
Resource we open in Base's __wakeup.
function Thing()
{
$this->member = new Child();
$this->another_member = 12345;
}
};
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31313&edit=1