php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27994 segfault with Soapserver when WSDL-Cache is enabled
Submitted: 2004-04-14 12:10 UTC Modified: 2004-08-26 17:28 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: waechter at avalus dot de Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.0.0RC1 OS: linux 2.4.18
Private report: No CVE-ID: None
 [2004-04-14 12:10 UTC] waechter at avalus dot de
Description:
------------
when wsdl-cache is enabled, the first call to soapserver works fine, but when the cached wsdl is beeing used (eg when it has not been written or ttl has reached), it will produce a segfault

Reproduce code:
---------------
configure line:
/configure
  --with-apxs2filter=/usr/local/apache2/bin/apxs
  --with-libxml-dir=../libxml2-2.6.7
  --enable-soap
  --enable-debug


php.ini:
soap.wsdl_cache_dir = /path/to/wsdl/cache
soap.wsdl_cache_enabled = 1
soap.wsdl_cache_ttl = 120


server-script:
<?php
  $server = new SoapServer("./path/to/wsdl.wsdl");
  $server->addFunction("someFunction");
  $server->handle();
?>

client-script:
<?php
  $client = new SoapClient("http://url/to/wsdl.de");
  $client->someFunction(array(
                         "param1" => "value1", 
                         "param2" => "value")
                        );
?>

Expected result:
----------------
no segfault ;-)

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.                          
[Switching to Thread 3076 (LWP 31697)]                                        
sdl_guess_convert_xml (enc=0x408d09c0, data=0x408e6858, style=1,              
    parent=0x83ac150)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2417         
2417            switch(type->kind) {                                          
(gdb) bt                                                                      
#0  sdl_guess_convert_xml (enc=0x408d09c0, data=0x408e6858, style=1,          
    parent=0x83ac150)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2417         
#1  0x4035a1cc in master_to_xml (encode=0x408d09c0, data=0x408e6858, style=1, 
    parent=0x83ac150)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:304          
#2  0x4035c024 in model_to_xml_object (node=0x83ac150, model=0x408d7530,      
    prop=0x408e56c0, style=1, strict=1)                                       
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1045         
#3  0x4035c13d in model_to_xml_object (node=0x83ac150, model=0x408d6ec8,      
    prop=0x408e56c0, style=1, strict=1)                                       
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1074         
#4  0x4035c714 in to_xml_object (type=0x408d0a28, data=0x408e6810, style=1,   
    parent=0x83ac058)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1244         
#5  0x403612ff in sdl_guess_convert_xml (enc=0x408d0a28, data=0x408e6810,     
    style=1, parent=0x83ac058)                                                
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2439         
#6  0x4035a1cc in master_to_xml (encode=0x408d0a28, data=0x408e6810, style=1, 
    parent=0x83ac058)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:304          
#7  0x4035ce38 in add_xml_array_elements (xmlParam=0x83ac058, type=0x0,       
    enc=0x408d0a28, ns=0x83a9038, dimension=1, dims=0x408e3f00,               
    data=0x408e4418, style=1)                                                 
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1454         
#8  0x4035eed6 in to_xml_array (type=0x408d0958, data=0x408e4418, style=1,    
    parent=0x83ab710)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1688         
#9  0x403612ea in sdl_guess_convert_xml (enc=0x408d0958, data=0x408e4418,     
    style=1, parent=0x83ab710)                                                
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2437         
#10 0x4035a1cc in master_to_xml (encode=0x408d0958, data=0x408e4418, style=1, 
    parent=0x83ab710)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:304          
#11 0x4035c024 in model_to_xml_object (node=0x83ab710, model=0x408d8060,      
    prop=0x408e7798, style=1, strict=1)                                       
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1045         
#12 0x4035c13d in model_to_xml_object (node=0x83ab710, model=0x408d7eb0,      
    prop=0x408e7798, style=1, strict=1)                                       
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1074         
#13 0x4035c714 in to_xml_object (type=0x408d08f0, data=0xbf3fd184, style=1,   
    parent=0x83ab6d0)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1244         
#14 0x403612ff in sdl_guess_convert_xml (enc=0x408d08f0, data=0xbf3fd184,     
    style=1, parent=0x83ab6d0)                                                
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2439         
#15 0x4035a1cc in master_to_xml (encode=0x408d08f0, data=0xbf3fd184, style=1, 
    parent=0x83ab6d0)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:304          
#16 0x40355e43 in serialize_zval (val=0xbf3fd184, param=0x408d9650,           
    paramName=0x408d96f8 "return", style=1, parent=0x83ab6d0,                 
---Type <return> to continue, or q <return> to quit---q                       
tsrm_ls=0x833edf8)Quit                                                        
(gdb) frame 0                                                                 
#0  sdl_guess_convert_xml (enc=0x408d09c0, data=0x408e6858, style=1,          
    parent=0x83ac150)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2417         
2417            switch(type->kind) {                                          
(gdb) bt                                                                      
#0  sdl_guess_convert_xml (enc=0x408d09c0, data=0x408e6858, style=1,          
    parent=0x83ac150)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2417         
#1  0x4035a1cc in master_to_xml (encode=0x408d09c0, data=0x408e6858, style=1, 
    parent=0x83ac150)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:304          
#2  0x4035c024 in model_to_xml_object (node=0x83ac150, model=0x408d7530,      
    prop=0x408e56c0, style=1, strict=1)                                       
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1045         
#3  0x4035c13d in model_to_xml_object (node=0x83ac150, model=0x408d6ec8,      
    prop=0x408e56c0, style=1, strict=1)                                       
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1074         
#4  0x4035c714 in to_xml_object (type=0x408d0a28, data=0x408e6810, style=1,   
    parent=0x83ac058)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1244         
#5  0x403612ff in sdl_guess_convert_xml (enc=0x408d0a28, data=0x408e6810,     
    style=1, parent=0x83ac058)                                                
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2439         
#6  0x4035a1cc in master_to_xml (encode=0x408d0a28, data=0x408e6810, style=1, 
    parent=0x83ac058)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:304          
#7  0x4035ce38 in add_xml_array_elements (xmlParam=0x83ac058, type=0x0,       
    enc=0x408d0a28, ns=0x83a9038, dimension=1, dims=0x408e3f00,               
    data=0x408e4418, style=1)                                                 
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1454         
#8  0x4035eed6 in to_xml_array (type=0x408d0958, data=0x408e4418, style=1,    
    parent=0x83ab710)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1688         
#9  0x403612ea in sdl_guess_convert_xml (enc=0x408d0958, data=0x408e4418,     
    style=1, parent=0x83ab710)                                                
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2437         
#10 0x4035a1cc in master_to_xml (encode=0x408d0958, data=0x408e4418, style=1, 
    parent=0x83ab710)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:304          
#11 0x4035c024 in model_to_xml_object (node=0x83ab710, model=0x408d8060,      
    prop=0x408e7798, style=1, strict=1)                                       
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1045         
#12 0x4035c13d in model_to_xml_object (node=0x83ab710, model=0x408d7eb0,      
    prop=0x408e7798, style=1, strict=1)                                       
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1074         
#13 0x4035c714 in to_xml_object (type=0x408d08f0, data=0xbf3fd184, style=1,   
    parent=0x83ab6d0)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:1244         
#14 0x403612ff in sdl_guess_convert_xml (enc=0x408d08f0, data=0xbf3fd184,     
    style=1, parent=0x83ab6d0)                                                
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:2439         
#15 0x4035a1cc in master_to_xml (encode=0x408d08f0, data=0xbf3fd184, style=1, 
    parent=0x83ab6d0)                                                         
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/php_encoding.c:304          
#16 0x40355e43 in serialize_zval (val=0xbf3fd184, param=0x408d9650,           
    paramName=0x408d96f8 "return", style=1, parent=0x83ab6d0,                 
---Type <return> to continue, or q <return> to quit---                        
    tsrm_ls=0x833edf8)                                                        
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/soap.c:3291                 
#17 0x40355df8 in serialize_parameter (param=0x408d9650, param_val=0xbf3fd184,
    index=0, name=0x4056fd4a "return", style=1, parent=0x83ab6d0,             
    tsrm_ls=0x833edf8)                                                        
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/soap.c:3276                 
#18 0x40353f25 in serialize_response_call2 (body=0x83a8fe8,                   
    function=0x408d8fe0,                                                      
    function_name=0x408e51f0 "queryAvailableFieldsResponse",                  
    uri=0x408d9738 "urn:avalusNET", ret=0xbf3fd184, version=1, main=1,        
    tsrm_ls=0x833edf8)                                                        
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/soap.c:2674                 
#19 0x40355237 in serialize_response_call (function=0x408d8fe0,               
    function_name=0x408e51f0 "queryAvailableFieldsResponse",                  
    uri=0x408d9738 "urn:avalusNET", ret=0xbf3fd184, headers=0x0, version=1,   
    tsrm_ls=0x833edf8)                                                        
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/soap.c:3016                 
#20 0x4034f0c8 in zif_soapserver_handle (ht=0, return_value=0x408cbb80,       
    this_ptr=0x408c4ef8, return_value_used=0, tsrm_ls=0x833edf8)              
    at /home/lbr/serverSoft/php-5.0.0RC1/ext/soap/soap.c:1506                 
#21 0x404c2685 in zend_do_fcall_common_helper (execute_data=0xbf3fd548,       
    opline=0x408c5b80, op_array=0x408c4d10, tsrm_ls=0x833edf8)                
    at /home/lbr/serverSoft/php-5.0.0RC1/Zend/zend_execute.c:2665             
#22 0x404c2d70 in zend_do_fcall_by_name_handler (execute_data=0xbf3fd548,     
    opline=0x408c5b80, op_array=0x408c4d10, tsrm_ls=0x833edf8)                
    at /home/lbr/serverSoft/php-5.0.0RC1/Zend/zend_execute.c:2776             
#23 0x404b5b4b in execute (op_array=0x408c4d10, tsrm_ls=0x833edf8)            
    at /home/lbr/serverSoft/php-5.0.0RC1/Zend/zend_execute.c:1339             
#24 0x40490bd6 in zend_execute_scripts (type=8, tsrm_ls=0x833edf8, retval=0x0,
    file_count=3) at /home/lbr/serverSoft/php-5.0.0RC1/Zend/zend.c:1046       
#25 0x4044d6d9 in php_execute_script (primary_file=0xbf3ff7f8,                
    tsrm_ls=0x833edf8) at /home/lbr/serverSoft/php-5.0.0RC1/main/main.c:1628  
#26 0x404cfc73 in php_output_filter (f=0x835a4d0, bb=0x835aac0)               
    at /home/lbr/serverSoft/php-5.0.0RC1/sapi/apache2filter/sapi_apache2.c:519
#27 0x080ac6c3 in ap_pass_brigade (next=0x835a4d0, bb=0x835a678)              
    at util_filter.c:550                                                      
#28 0x080b36a2 in default_handler (r=0x8358d50) at core.c:3558                
#29 0x080a1938 in ap_run_handler (r=0x8358d50) at config.c:194                
#30 0x080a1efe in ap_invoke_handler (r=0x8358d50) at config.c:401             
#31 0x08099fc6 in ap_process_request (r=0x8358d50) at http_request.c:288      
#32 0x08095afb in ap_process_http_connection (c=0x8354e30) at http_core.c:293 
#33 0x080aa938 in ap_run_process_connection (c=0x8354e30) at connection.c:85  
#34 0x080aac10 in ap_process_connection (c=0x8354e30, csd=0x8354d40)          
    at connection.c:211                                                       
#35 0x0809e991 in process_socket (p=0x8354d08, sock=0x8354d40, my_child_num=0,
    my_thread_num=1, bucket_alloc=0x8356d10) at worker.c:632                  
#36 0x0809efd6 in worker_thread (thd=0x81da8a0, dummy=0x82e51d0)              
    at worker.c:946                                                           
#37 0x400a60b3 in dummy_worker (opaque=0x81da8a0) at thread.c:127             
#38 0x4013ae67 in pthread_start_thread () from /lib/libpthread.so.0           
#39 0x4013aeb5 in pthread_start_thread_event () from /lib/libpthread.so.0     


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-14 22:25 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

..and why did you add those extra empty lines in the backtrace?!?!?!

 [2004-04-15 06:34 UTC] dmitry@php.net
I need full example (including wsdl file) to reproduce the BUG.
 [2004-04-15 08:40 UTC] waechter at avalus dot de
okay, I found somewhat interesting:

the segfault happens, when i try to use an unknown datatype inside the wsdl. in my case, i used xsd:base64binary instead of xsd:base64Binary (case-sensitiv)...

do you still need the sourcecode?

and those extra empty lines in the BT... sorry, i don't know where these came from!?
 [2004-08-26 17:28 UTC] dmitry@php.net
It is the same as bug #29795.
Fixed in CVS (HEAD & PHP_5_0)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 02:01:30 2024 UTC