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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hellekin@php.net
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Apr 18 07:01:27 2024 UTC