W3C home > Mailing lists > Public > www-lib@w3.org > January to March 2003

Memory Leaks (HTMemory_malloc)

From: <Papandreou.George@ic.gc.ca>
Date: Mon, 6 Jan 2003 12:43:44 -0500
Message-ID: <5A3DC0846A53044E84260D3750370BFB17AD70@mb-bp-012.ic.gc.ca>
To: www-lib@w3.org

Greetings and Happy New Year!

We have been experiencing crashes (over time, say after 10 consecutive
requests) in our HTTP client app that uses libwww.  This application
performs POSTs of XML documents via SSL.

Here is what dbx reports on Solaris 9:

Running: Test_POST_App_sun 
(process id 5710)
Reading librtc.so
RTC: Enabling Error Checking...
signal SEGV (no mapping at the fault address) in (unknown) at 0x10
0x00000010:     <bad address 0x10>
Current function is doPost
 1077                       HTEventList_loop(request);
(/opt/SUNWspro/WS6/bin/sparcv9/dbx) showleaks
Checking for memory leaks...

Actual leaks report    (actual leaks:       190  total size:    2508 bytes)

 Total  Num of  Leaked      Allocation call stack
 Size   Blocks  Block
                Address
======  ====== ==========  =======================================
  1463      76      -      HTMemory_malloc < prefixed 
   912      76      -      calloc < HTMemory_calloc 
   133      38      -      HTMemory_malloc < HTSACopy 
 

Possible leaks report  (possible leaks:       0  total size:       0 bytes)

I did not read of any outstanding memory leak bugs in libwww.  Could it be
because of the OS?

Here is how we close down a request in terminate_handler()
            ...
			    /* Delete chunk */
			    HTChunk_delete(userData->result);

			    /* We are done with this request */
			    HTRequest_delete(request);
			    request = NULL;

			    /* Close down SSL */
			    if (userData->isSecure) {
			        HTSSLhttps_terminate();
			    }

			    /* Terminate libwww */
			    HTProfile_delete();

			    /* Mailing list says this clears up all memory
problems */
			    HTAnchor_deleteAll(NULL);

			    /* Stop the event loop */
			    HTEventList_stopLoop();

			    /* Remove the handler */
			    HTNet_deleteAfter(terminateHandler);

Could it be the sequence of these close down calls?

Any help would be appreciated.
Thanks!
Received on Monday, 6 January 2003 12:43:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:43 GMT