From: Operating system: fedora 14 PHP version: 5.3.10 Package: cURL related Bug Type: Bug Bug description:Memory leak when using ssl_verifPeer true
Description: ------------ PHP 5.3.10 (cli) (built: Feb 4 2012 08:56:48) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.1.3, Copyright (c) 2002-2012, by Derick Rethans libcurl-7.24.0-1.0.cf.fc14.i686 nss-3.12.10-7.fc14.i686 openssl-1.0.0e-1.fc14.i686 Test script: --------------- #! /usr/bin/env php <?php class httpsTest{ function curlHttps($memLeak=false){ $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://sqs.us-east-1.amazonaws.com'); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $memLeak); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_exec($curl); curl_close($curl); } } gc_enable(); $myPid = getmypid();$i=0; $test = new httpsTest(); while ($test){ $test->curlHttps(true); echo $i++ ." PHP Info MemUsage: ".memory_get_usage() ." Linux Info "; system('cat /proc/' .$myPid .'/status|grep '.'"VmSize"'); sleep(1); } Expected result: ---------------- The memory usage for PHP and Linux VMSize should stay level over time, which is the case when $test->curlHttps(false); is used Actual result: -------------- The php memory usage is level but the Linux process memory usage is growing with 132K bytes per 18 iterations. -- Edit bug report at https://bugs.php.net/bug.php?id=61030&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61030&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61030&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61030&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61030&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61030&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61030&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61030&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61030&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61030&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61030&r=support Expected behavior: https://bugs.php.net/fix.php?id=61030&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61030&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61030&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61030&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61030&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61030&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61030&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61030&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61030&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61030&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61030&r=mysqlcfg