Bug #75306 [Ver->Csd]: Memleak in SoapClient

From: Date: Thu, 26 Oct 2023 18:00:34 +0000
Subject: Bug #75306 [Ver->Csd]: Memleak in SoapClient
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245656@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75306&edit=1 ID: 75306 Updated by: git@php.net Reported by: valov at mtsbank dot ru Summary: Memleak in SoapClient -Status: Verified +Status: Closed Type: Bug Package: SOAP related Operating System: RHEL 6 PHP Version: 7.1.10 Block user comment: N Private report: N New Comment: Automatic comment on behalf of nielsdos Revision: https://github.com/php/php-src/commit/27797a26caa8368b6158e7b11cbbc661fc495772 Log: Fix bug #75306: Memleak in SoapClient Previous Comments: ------------------------------------------------------------------------ [2018-11-04 11:04:37] cmb@php.net The following patch has been added/updated: Patch Name: fix-refcounting Revision: 1541329477 URL: https://bugs.php.net/patch-display.php?bug=75306&patch=fix-refcounting&revision=1541329477 ------------------------------------------------------------------------ [2018-11-04 11:04:34] cmb@php.net In this case, a new stream context is allocated[1], converted to a zval[2] which increases the refcount, but the refcount is only decreased once[3], resulting in the reported memory leak. So not increasing the refcount when converting to a zval would solve this issue. However, if a stream context is passed in the $options array, its refcount has to be increased to avoid premature freeing. [1] <https://github.com/php/php-src/blob/php-7.3.0RC4/ext/soap/php_sdl.c#L3238> [2] <https://github.com/php/php-src/blob/php-7.3.0RC4/ext/soap/php_sdl.c#L3303> [3] <https://github.com/php/php-src/blob/php-7.3.0RC4/ext/soap/php_sdl.c#L3318> ------------------------------------------------------------------------ [2018-01-01 21:13:00] nikic@php.net Related To: Bug #74119 ------------------------------------------------------------------------ [2018-01-01 21:10:57] nikic@php.net Can reproduce with soap.wsdl_cache_enabled=0. ------------------------------------------------------------------------ [2017-10-03 09:00:41] valov at mtsbank dot ru Description: ------------ Memleak in SoapClient detected, in test script after few seconds you will get error: "Allowed memory size exhausted". Test script: --------------- <?php while(true) { $client = new SoapClient("test.wsdl"); } ?> You can use any test.wsdl specification, for example https://www.tutorialspoint.com/wsdl/wsdl_example.htm ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75306&edit=1

« previous php.bugs (#245656) next »