php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70900 SoapClient systematic out of memory error
Submitted: 2015-11-12 10:33 UTC Modified: 2015-11-12 17:39 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: benjamin dot morel at gmail dot com Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5.6 OS: Fedora 23
Private report: No CVE-ID:
 [2015-11-12 10:33 UTC] benjamin dot morel at gmail dot com
Description:
------------
I cannot instantiate a single SoapClient instance, without getting a memory error.
I raised memory_limit to 1GB, but this didn't change anything: now the library tries to allocate 1.5GB of memory for some obscure reason.

Note that this occurs *before* the SOAP client downloads the WSDL file, as I get this exception in less than 1ms.

Test script:
---------------
new \SoapClient(
    'http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl'
);

Actual result:
--------------
SoapFault exception: [Client] Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1644167200 bytes)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-12 10:37 UTC] benjamin dot morel at gmail dot com
Actually this bug had already been reported as far as in PHP 7.0.0alpha2, but due to the original reporter not answer the question, it's been closed:

https://bugs.php.net/bug.php?id=69942

But it's definitely still present in RC7.

Hopefully you'll be able to reproduce it with this one-liner.
 [2015-11-12 16:10 UTC] laruence@php.net
-Assigned To: +Assigned To: dmitry
 [2015-11-12 16:58 UTC] ab@php.net
-PHP Version: 7.0.0RC7 +PHP Version: 5.6
 [2015-11-12 16:58 UTC] ab@php.net
@benjamin Thanks for the repro case.

So far I was checking, same is reproduceable with 5.6 as well. It has something to do with serealization/deserealization of WSDL. Only reproduceable on second call after the cached WSDL gets deserialized, so soap.wsdl_cache_dir=/some/valid/dir is required to repro.

Thanks.
 [2015-11-12 17:37 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f8bf9bd86bdeef33a48e43d772d8a25a4fe3e6ff
Log: Fixed bug #70900 (SoapClient systematic out of memory error)
 [2015-11-12 17:37 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 [2015-11-12 17:39 UTC] dmitry@php.net
you'll have to manually clean WSDL cache (rm /tmp/wsdl-*) after update.
 [2015-11-12 21:50 UTC] benjamin dot morel at gmail dot com
@dmitry, works a treat with your latest commit! Thanks so much.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Apr 30 01:01:34 2017 UTC