cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory leaks

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Sun, 4 Apr 2010 13:15:28 +0200

On Sunday 04 of April 2010 12:57:20 Julian Kranz wrote:
> As far as I can see it's not growing. But I still think it's bad. "Still
> reachable" means that global variables still point to allocaed memory.
> But as I don't want to continue using curl at that point (the
> application is exiting), it should not be keeping any memory right now.

To be honest, I didn't look thoroughly at that backtrace as I don't use
OpenSSL powered libcurl myself.

> This is what you've got your curl_global_cleanup() for, isn't it? As
> this function does not have any argument, it will only free memory that
> would be "still reachable" in the end otherwise.

We use NSS instead of OpenSSL on Fedora and I was tracking a lot of
"definitely lost" memory leaks there recently. Nevertheless there was
nothing I could do with the "possibly lost". Once you call PR_Socket()
there, valgrind claims there is 48B of possibly lost memory. But if you
call the PR_Socket() in a loop the amount of "possibly lost" memory
doesn't grow, so I don't see it as bug.

As for the OpenSSL, you will probably need to go through the backtrace
and check if the "possibly lost" memory is expected there or not.

Kamil
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-04