cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Apparent memory leak deep in cURL library; requesting assistance

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 18 Feb 2011 09:37:03 +0100 (CET)

On Thu, 17 Feb 2011, Fisher, Matt wrote:

> * Wind River's MemScope tool is used to analyze the allocation and freeing
> of dynamic memory blocks. MemScope logs every single dynamic memory
> allocation & free, so when a test run is complete it is easy to see any
> blocks that have not been freed.

It's a pity it doesn't properly record source+line as well (hello valgrind) as
then it'd be slightly easier to fully understand this...

Can you figure out exactly which Curl_add_buffer() call that does this 20 byte
malloc?

> Curl_http;1;0;20;20 <--- curl/http.c::Curl_http()
> . Curl_add_buffer;1;0;20;20 <--- curl/http.c::Curl_add_buffer()
> . . malloc;1;0;20;20 <--- VxWorks malloc()
> . Curl_http;1;1;12;0
> . . Curl_add_buffer_init;1;1;12;0
> . . . calloc;1;1;12;0
> . Curl_http;1;1;488;0
> . . Curl_add_buffer;1;1;488;0

What looks suspicious in this flow is that Curl_add_buffer_init() is called
_after_ that first 20-byte Curl_add_buffer() call. It feels like that might
should be investigated closer. If you can just set a break-point in there and
see...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-18