#31313 [Fbk->NoF]: $this reference is bad during __wakeup
| From: | php-bugs at lists dot php dot net | Date: | Wed, 06 Apr 2005 23:00:07 +0000 |
| Subject: | #31313 [Fbk->NoF]: $this reference is bad during __wakeup | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76463@lists.php.net to get a copy of this message | ||
ID: 31313
Updated by: php-bugs@lists.php.net
Reported By: bugs dot php dot net at future dot shiny dot co dot il
-Status: Feedback
+Status: No Feedback
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4CVS-2005-01-20
New Comment:
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
Previous Comments:
------------------------------------------------------------------------
[2005-03-30 23:05:20] tony2001@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
------------------------------------------------------------------------
[2005-01-20 14:50:25] bugs dot php dot net at future dot shiny dot co
dot il
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?
------------------------------------------------------------------------
[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