php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14950 crash with __sleep() and __wakeup()
Submitted: 2002-01-09 10:36 UTC Modified: 2002-10-14 19:26 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: hellekin@php.net Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.2.0-dev OS: Debian SID
Private report: No CVE-ID: None
 [2002-01-09 10:36 UTC] hellekin@php.net
Passing objects using the magic __sleep() and __wakeup() methods through sessions fail.

In the best case the script fails without error. In the worst, an integer in session turns into the value of the PHP session ID and the object is not registered.

Yasuo Ohgaki guesses it's a serialize/unserialize problem.

Make log :

/usr/src/web/php/php4/ext/standard/var_unserializer.re: In function `php_var_unserialize':
/usr/src/web/php/php4/ext/standard/var_unserializer.re:304: warning: comparison is always false due to limited range of data type

Tests : http://php.hellekin.com/test/session/
PHPInfo() : http://php.hellekin.com/info.php

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-09 10:38 UTC] hellekin@php.net
Forgot to tell : asking for .phps will show you the source in the /test/session/ directory.
 [2002-02-03 19:44 UTC] yohgaki@php.net
This will be next my target to fix :)
 [2002-03-06 03:25 UTC] yohgaki@php.net
Version update

I just take a look at what is going on, __sleep and __wakeup is messed badly. It does not work at all and even crashes...

 [2002-03-22 05:30 UTC] yohgaki@php.net
Could you try CVS version to see if this bug is fixed?
 [2002-04-03 11:06 UTC] yohgaki@php.net
I just tested. It does not work.
 [2002-04-13 12:48 UTC] artus at nickpicker dot de
I have the same problem running apache 2.0.35 and php 4.2 RC3 under Win2K ...
 [2002-05-28 14:58 UTC] ben at luistert dot nl
I use php 4.2.1 as apache module on a win95 system and it crashes whenever I try to serialize an object (in a session or otherwise) that has a __sleep() function.
 [2002-09-16 08:09 UTC] bs_php at sourceforge dot com
Bug remains (Apache crash)
SERVER_SOFTWARE: Apache/1.3.26 (Win32) PHP/4.2.3 
OS: Win2000
Apache: 1.3.26

Sample Code:
<?php
class A {
  function A() {}
  function __sleep() {return;}
}
$a = new A();
$stream = serialize($a);
?>
 [2002-09-26 16:41 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip

Cannot replicate this using latest CVS on Windows or Linux.
 [2002-10-14 19:26 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, 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".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC