From:             meatloafninja at gmail dot com
Operating system: CentOS 5.x
PHP version:      5.2.12
PHP Bug Type:     SOAP related
Bug description:  Memory corruption / SegFault with WSDL in-memory cache

Description:
------------
If you enable WSDL caching and set the cache type to 2 (memory) or 3 (both
disk and memory), and create a SoapServer with a WSDL, and within the
context of that SoapServer create multiple SoapClient connections to
external web services with WSDLs (exceeding the soap.wsdl_cache_limit
setting), the SoapServer's in-memory copy of its own WSDL will get removed
/ freed.

This causes a segmentation fault of the web server child process or a
corrupt / invalid XML response, as the SoapServer will be unable to access
its own WSDL when the time comes to send its response to the original
requesting client.

The SoapServer WSDL should be protected from removal.



Reproduce code:
---------------
<?php
ini_set('soap.wsdl_cache_enabled', 1);
ini_set('soap.wsdl_cache', 3);

function test($x)
{
    $client1 = new SoapClient("http://some.other.host/client1.wsdl";);
    $client2 = new SoapClient("http://some.other.host/client2.wsdl";);
    $client3 = new SoapClient("http://some.other.host/client3.wsdl";);
    $client4 = new SoapClient("http://some.other.host/client4.wsdl";);
    $client5 = new SoapClient("http://some.other.host/client5.wsdl";);

    return $x; //web server segfaults or corrupt XML returned
}

$server = new SoapServer("server.wsdl");
$server->addFunction("test");
$server->handle();
?>

Expected result:
----------------
A valid XML response as defined by server.wsdl.

Actual result:
--------------
Either a segmentation fault on the web server and a "Could not fetch HTTP
headers" error on the client, or a corrupted XML response.

-- 
Edit bug report at http://bugs.php.net/?id=50722&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50722&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50722&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50722&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50722&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50722&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50722&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50722&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50722&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50722&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50722&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50722&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50722&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50722&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50722&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50722&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50722&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50722&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50722&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50722&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50722&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50722&r=mysqlcfg

Reply via email to