[Help-gnutls] GnuTLS 2.2.1 memory leaks or just bad usage?

Daniel Stenberg daniel at haxx.se
Sat Feb 16 11:14:20 CET 2008


Hi again,

When I run valgrind on curl built with GnuTLS and run it like this:

$ valgrind --leak-check=full curl https://www.openssl.org/ -v -k

I get two different leaks reported, and while I'm not done researching these I 
thought I'd post them here in case someone else wants to help out:

(It's not obvious to me that we're doing anything "illegal" in terms of API 
usage in the libcurl code.)

==19167== 128 bytes in 1 blocks are definitely lost in loss record 2 of 9
==19167==    at 0x4022AB8: malloc (vg_replace_malloc.c:207)
==19167==    by 0x40F64A3: _gnutls_mpi_dprint_lz (in 
/usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x4102A40: _gnutls_dh_set_peer_public (in 
/usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x4108110: _gnutls_proc_dh_common_server_kx (in 
/usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x40FFEE8: (within /usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x40ED6D8: _gnutls_recv_server_kx_message (in 
/usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x40E9C8E: _gnutls_handshake_client (in 
/usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x40EA589: gnutls_handshake (in /usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x808D428: handshake (gtls.c:156)
==19167==    by 0x808D9BD: Curl_gtls_connect (gtls.c:326)
==19167==    by 0x8063372: Curl_ssl_connect (sslgen.c:215)
==19167==    by 0x806E92A: Curl_http_connect (http.c:1700)
==19167==
==19167==
==19167== 3,506 bytes in 2 blocks are definitely lost in loss record 5 of 9
==19167==    at 0x4022AB8: malloc (vg_replace_malloc.c:207)
==19167==    by 0x40F5D85: _gnutls_session_pack (in 
/usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x40F056C: gnutls_session_get_data (in 
/usr/lib/libgnutls.so.26.1.2)
==19167==    by 0x808DFAC: Curl_gtls_connect (gtls.c:506)
==19167==    by 0x8063372: Curl_ssl_connect (sslgen.c:215)
==19167==    by 0x806E92A: Curl_http_connect (http.c:1700)
==19167==    by 0x807C337: Curl_protocol_connect (url.c:2782)
==19167==    by 0x807E962: SetupConnection (url.c:4268)
==19167==    by 0x807EAC2: Curl_connect (url.c:4342)
==19167==    by 0x8086EDD: connect_host (transfer.c:2271)
==19167==    by 0x808712E: Curl_perform (transfer.c:2367)
==19167==    by 0x805BF91: curl_easy_perform (easy.c:508)
==19167==
==19167== LEAK SUMMARY:
==19167==    definitely lost: 3,634 bytes in 3 blocks.
==19167==      possibly lost: 0 bytes in 0 blocks.
==19167==    still reachable: 68,792 bytes in 4,040 blocks.
==19167==         suppressed: 0 bytes in 0 blocks.
==19167== Reachable blocks (those to which a pointer was found) are not shown.






More information about the Gnutls-help mailing list