# RM decision on BUG #55801 / FR #36424

- Thread: https://externals.io/message/55698
- Original archive: https://news-web.php.net/php.internals/55698
- Started by Michael Wallner on 2011-10-04T16:12:28+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #55698 — Michael Wallner — 2011-10-04T16:12:28+00:00

URL: https://externals.io/message/55698#55698

Hi, could the release manager(s) please take a 
decision on mentioned bug/feature request?

Thanks a lot,
Mike

---

## #55705 — Stas Malyshev — 2011-10-06T15:26:49+00:00

URL: https://externals.io/message/55698#55705 · In reply to: #55698

Hi!


> Hi, could the release manager(s) please take a
> decision on mentioned bug/feature request?

Could you give a quick summary of what the decision point is just so I 
won't miss anything scanning through the discussion and these bugs?

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

---

## #55724 — Michael Wallner — 2011-10-07T09:11:37+00:00

URL: https://externals.io/message/55698#55724 · In reply to: #55705

Hi Stas,



> Could you give a quick summary of what the decision point is just so I
> won't miss anything scanning through the discussion and these bugs?

In r299770 [1] I introduced a global var_hash to `serialize()` so that
recursive calls to `serialize()`/unserialize() can know about the same
objects/variable references.

This was IMO a good thing to do (tm), but it obviously broke 
serializ behaviour when called in __sleep/__wakeup, because of 
the order of calls:

serialize(obj)		
 -> obj->__sleep does `serialize()` (in user code)
 -> then internally serialize(obj->prop) happens
 
unserialize(obj)
 -> internally unserialize(obj->prop) is done
 -> obj->__wakeup is called which does `unserialize()` (user code)

As one can see the IDs of the referenced objects when unserializing 
cannot match 
the IDs at serialization time, because of the mixed up call order.


So I can only see two solutions:
 - either disallow serialize/unserialize in __sleep/__wakeup 
 - or revert r299770


... unless someone else has a better idea.
 
 
[1] http://svn.php.net/viewvc/?view=revision&revision=299770


Mike

---

## #55810 — Stas Malyshev — 2011-10-16T00:06:19+00:00

URL: https://externals.io/message/55698#55810 · In reply to: #55724

Hi!


> So I can only see two solutions:
>   - either disallow serialize/unserialize in __sleep/__wakeup
>   - or revert r299770

So, what is the status of this? I think we better revert it for 5.4 and 
look for solution that does not mess up existing code.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

---

## #55847 — David Soria Parra — 2011-10-17T14:04:25+00:00

URL: https://externals.io/message/55698#55847 · In reply to: #55810

> Hi!
>
> 
> > […]
>
> So, what is the status of this? I think we better revert it for 5.4 and 
> look for solution that does not mess up existing code.
I wrote Michael, that I think we should revert this.

---

## #55855 — Michael Wallner — 2011-10-18T07:49:34+00:00

URL: https://externals.io/message/55698#55855 · In reply to: #55810

> Hi!
> 
> So, what is the status of this? I think we better revert it for 5.4 and
> look for solution that does not mess up existing code.

Hi there!

Yes, I received your mails, sorry for being quiet!

I cooked up a patch which uses clean var_hashs or (un)serialize 
within __wakeup and __sleep.

Tests pass, my test case in the bug produces a stack overflow,
which is IMO expected.  I'm just waiting for feedback of the
bug reporter.

Thanks,
Mike
