php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26781 wddx session handler crash with class variable.
Submitted: 2004-01-04 09:14 UTC Modified: 2004-02-09 18:04 UTC
From: hirokawa@php.net Assigned:
Status: Closed Package: Session related
PHP Version: 5CVS OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hirokawa@php.net
New email:
PHP Version: OS:

 

 [2004-01-04 09:14 UTC] hirokawa@php.net
Description:
------------
wddx session handler is work well for string and integer variables.
But, web server always crash when I tried to recover session variables after php object was saved as session variable.

my php.ini,
session.serialize_handler = wddx
session.save_path = "c:\temp"


Reproduce code:
---------------
<?php 
class MyClass {
 public $c;
 function __construct() {
    $this->c = 'foo';
 }
 function show() {
    return $this->c;
 }
}

session_start();
if (!isset($_SESSION['c'])) {
 $c = new MyClass();
 $_SESSION['c'] = $c;
}

print $_SESSION['c']->show();
?>

Expected result:
----------------
foo

Actual result:
--------------
When reload this script, web server should be terminated.
For another serializer such as php or php_binary,
it works well as expected.

 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-06 20:48 UTC] sniper@php.net
#0  0x3d205d27 in ?? ()
#1  0x0832f5fe in _object_and_properties_init (arg=0x40e49afc, class_type=0x87401fc, properties=0x0, 
    __zend_filename=0x8558dc0 "/usr/src/web/php/php5/ext/wddx/wddx.c", __zend_lineno=956)
    at /usr/src/web/php/php5/Zend/zend_API.c:725
#2  0x0832f636 in _object_init_ex (arg=0x40e49afc, class_type=0x87401fc, 
    __zend_filename=0x8558dc0 "/usr/src/web/php/php5/ext/wddx/wddx.c", __zend_lineno=956)
    at /usr/src/web/php/php5/Zend/zend_API.c:732
#3  0x082d26fb in php_wddx_pop_element (user_data=0xbfffd3e0, name=0x8741400 "string")
    at /usr/src/web/php/php5/ext/wddx/wddx.c:956
#4  0x082d8215 in _end_element_handler (user=0x40e49680, name=0x87413d8 "string")
    at /usr/src/web/php/php5/ext/xml/compat.c:198
#5  0x40bb187c in xmlParseStartTag () from /usr//lib/libxml2.so.2
#6  0x40bb1979 in xmlParseEndTag () from /usr//lib/libxml2.so.2
#7  0x40bb537c in xmlParseExtParsedEnt () from /usr//lib/libxml2.so.2
#8  0x40bb577f in xmlParseChunk () from /usr//lib/libxml2.so.2
#9  0x082d887d in php_XML_Parse (parser=0x40e49680, 
    data=0x40e493fc "<wddxPacket version='1.0'><header/><data><struct><var name='c'><struct><var name='php_class_name'><string>myclass</string></var><var name='c'><string>foo</string></var></struct></var></struct></data><"..., data_len=212, 
    is_final=1) at /usr/src/web/php/php5/ext/xml/compat.c:501
#10 0x082d2d40 in php_wddx_deserialize_ex (
    value=0x40e493fc "<wddxPacket version='1.0'><header/><data><struct><var name='c'><struct><var name='php_class_name'><string>myclass</string></var><var name='c'><string>foo</string></var></struct></var></struct></data><"..., vallen=212, 
    return_value=0x40e49508) at /usr/src/web/php/php5/ext/wddx/wddx.c:1104
#11 0x082ccc7f in ps_srlzr_decode_wddx (
    val=0x40e493fc "<wddxPacket version='1.0'><header/><data><struct><var name='c'><struct><var name='php_class_name'><string>myclass</string></var><var name='c'><string>foo</string></var></struct></var></struct></data><"..., vallen=212)
    at /usr/src/web/php/php5/ext/wddx/wddx.c:273
#12 0x081ef381 in php_session_decode (
    val=0x40e493fc "<wddxPacket version='1.0'><header/><data><struct><var name='c'><struct><var name='php_class_name'><string>myclass</string></var><var name='c'><string>foo</string></var></struct></var></struct></data><"..., vallen=212)
    at /usr/src/web/php/php5/ext/session/session.c:549
#13 0x081ef9a9 in php_session_initialize () at /usr/src/web/php/php5/ext/session/session.c:730
#14 0x081f1957 in php_session_start () at /usr/src/web/php/php5/ext/session/session.c:1162
#15 0x081f33b0 in zif_session_start (ht=0, return_value=0x40e4ab40, this_ptr=0x0, return_value_used=0)
    at /usr/src/web/php/php5/ext/session/session.c:1601
#16 0x08352ee0 in zend_do_fcall_common_helper (execute_data=0xbfffd790, op_array=0x40e48710)
    at /usr/src/web/php/php5/Zend/zend_execute.c:2535
#17 0x083536ad in zend_do_fcall_handler (execute_data=0xbfffd790, op_array=0x40e48710)
    at /usr/src/web/php/php5/Zend/zend_execute.c:2682
#18 0x0834f18c in execute (op_array=0x40e48710) at /usr/src/web/php/php5/Zend/zend_execute.c:1260
#19 0x0832da5c in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/web/php/php5/Zend/zend.c:1050
#20 0x082ead64 in php_execute_script (primary_file=0xbffffb90) at /usr/src/web/php/php5/main/main.c:1642
#21 0x0836740c in main (argc=4, argv=0xbffffc24) at /usr/src/web/php/php5/sapi/cli/php_cli.c:925

 [2004-01-10 10:24 UTC] moriyoshi@php.net
Could this be reproduced with expat also..?
 [2004-02-08 11:27 UTC] sniper@php.net
Please try using this CVS snapshot:

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

I can't reproduce this anymore..

 [2004-02-09 18:04 UTC] hirokawa@php.net
This problem was fixed in CVS HEAD.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 08:01:30 2025 UTC