Bug #69998 [Ver->Csd]: curl multi leaking memory
| From: | pierrick@php.net | Date: | Sat, 01 Aug 2015 18:55:22 +0000 |
| Subject: | Bug #69998 [Ver->Csd]: curl multi leaking memory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194881@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69998&edit=1
ID: 69998
Updated by: pierrick@php.net
Reported by: fred_brownuk at yahoo dot co dot uk
Summary: curl multi leaking memory
-Status: Verified
+Status: Closed
Type: Bug
Package: cURL related
Operating System: Mint 17.1 & Debian 6 LTS
PHP Version: 7.0.0alpha2
Assigned To: pierrick
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of pierrick@webstart.fr
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fb37da2a4875abc2153da583faca6c7554810ce9
Log: Fixed Bug #69998 curl multi leaking memory
Previous Comments:
------------------------------------------------------------------------
[2015-07-10 09:00:55] mike@php.net
Resource leaks of zend_list are not detectable by valgrind/memcheck IIRC, because the table is
cleaned up anyway at the end of the request.
When you run a modified (say 100k loop count) script with valgrind/massif, you'll see that
zend_list_insert() of zif_curl_multi_init() keeps growing the resource table, though.
------------------------------------------------------------------------
[2015-07-09 15:33:28] fred_brownuk at yahoo dot co dot uk
I get the issue with both versions of libcurl I've tried, my distro has 7.35.0 and I've
also tried with the newer 7.43.0
Incidentally, I've just tried building php 7 from git master, the errors regarding
"Conditional jump or move depends on uninitialised value(s)" are no longer present, but
the other issues remain.
------------------------------------------------------------------------
[2015-07-09 15:12:02] cmb@php.net
I get a similar valgrind report when running the supplied test
script. It seems to me that the "Conditional jump or move depends
on uninitialised value(s)" might be a bogus warning (aka. false
positive). The leaks (64 bytes in 2 blocks for me), however, occur
also for an empty PHP script.
Fred, which libcurl do you use?
------------------------------------------------------------------------
[2015-07-09 11:33:55] fred_brownuk at yahoo dot co dot uk
Thanks for looking. Sorry this doesn't mean much to me, but here you go.
==15597== Memcheck, a memory error detector
==15597== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==15597== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==15597== Command: curlphpalpha2/bin/php bug69998.php
==15597==
==15597== Conditional jump or move depends on uninitialised value(s)
==15597== at 0x5ACD79: curl_compare_resources (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x8AC3B4: zend_llist_del_element (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x5AD01F: zif_curl_multi_remove_handle (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x90C5AC: ZEND_DO_ICALL_SPEC_HANDLER (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x8FCFEA: execute_ex (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x95BFC2: zend_execute (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x8BA22D: zend_execute_scripts (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x851B4F: php_execute_script (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x95D822: do_cli (in /home/fred/curlphpalpha2/bin/php)
==15597== by 0x43C1FA: main (in /home/fred/curlphpalpha2/bin/php)
==15597==
resource(5) of type (curl)
resource(5) of type (curl)
354976
355320
355344
355368
355392
356056
356080
356104
356128
356152
==15597==
==15597== HEAP SUMMARY:
==15597== in use at exit: 1,030 bytes in 22 blocks
==15597== total heap usage: 32,419 allocs, 32,397 frees, 3,405,857 bytes allocated
==15597==
==15597== LEAK SUMMARY:
==15597== definitely lost: 0 bytes in 0 blocks
==15597== indirectly lost: 0 bytes in 0 blocks
==15597== possibly lost: 0 bytes in 0 blocks
==15597== still reachable: 1,030 bytes in 22 blocks
==15597== suppressed: 0 bytes in 0 blocks
==15597== Reachable blocks (those to which a pointer was found) are not shown.
==15597== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==15597==
==15597== For counts of detected and suppressed errors, rerun with: -v
==15597== Use --track-origins=yes to see where uninitialised values come from
==15597== ERROR SUMMARY: 11 errors from 1 contexts (suppressed: 0 from 0)
------------------------------------------------------------------------
[2015-07-09 11:08:13] kalle@php.net
Can you confirm this leak with a valgrind output or similar? valgrind --leak-check=yes php
bug69998.php should be sufficient to confirm this
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=69998
--
Edit this bug report at https://bugs.php.net/bug.php?id=69998&edit=1