curl / Mailing Lists / curl-library / Single Mail

curl-library

open ssl vs gnutls used along with libcurl

From: surya chandrika via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 5 Oct 2018 14:07:08 +0530

Hi All,

There is a weird memory leak in my program.

Valgrind shows:

1.
We have a usecase within program which uses gnu encrypt decrypt function,
and it reports leaks.

==57842== 775 (152 direct, 623 indirect) bytes in 1 blocks are definitely
lost in loss record 2,287 of 2,663

==57842== at 0x4C29975: calloc (vg_replace_malloc.c:711)

==57842== by 0xF62230B: ??? (in /usr/lib64/libtasn1.so.6.5.3)

==57842== by 0xF6224BB: asn1_create_element (in
/usr/lib64/libtasn1.so.6.5.3)

==57842== by 0x7B1ACB2: ??? (in /usr/lib64/libgnutls.so.28.43.0)

==57842== by 0x7B1D8F3: ??? (in /usr/lib64/libgnutls.so.28.43.0)

==57842== by 0x7B1DC75: gnutls_x509_privkey_export_pkcs8 (in
/usr/lib64/libgnutls.so.28.43.0)

So i was searching a bit about gnu and found this link, where it states
gnu used along curl can also leak

https://github.com/curl/curl/issues/1086

Is there any known issues like curl with gnu has leaks?

Will switching to openssl solve this problem as stated in this link?

2.

Also in valgrind i can see , opessl backtrace even though am using gnutls ,
is this related:

==70015== 24 bytes in 1 blocks are still reachable in loss record 27 of 662

==70015== at 0x4C27BE3: malloc (vg_replace_malloc.c:299)

==70015== by 0xDCCC3B7: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.2k)

==70015== by 0xDCCF238: OBJ_NAME_add (in /usr/lib64/libcrypto.so.1.0.2k)

==70015== by 0xDD8E394: EVP_add_cipher (in
/usr/lib64/libcrypto.so.1.0.2k)

==70015== by 0xDD92E8C: OpenSSL_add_all_ciphers (in
/usr/lib64/libcrypto.so.1.0.2k)

==70015== by 0xDD92B4D: OPENSSL_add_all_algorithms_noconf (in
/usr/lib64/libcrypto.so.1.0.2k)

==70015== by 0x1014B428: libssh2_init (in /usr/lib64/libssh2.so.1.0.1)

==70015== by 0x7DEF936: curl_global_init (easy.c:273)

3. I have 182 hits for the below backtrace in my valgrind log , although
its invoked only once and global cleanup in invoked at the end of program.
This program is a long running program and we dont expect to stop or
restart in between.

==70015== at 0x4C27BE3: malloc (vg_replace_malloc.c:299)

==70015== by 0x11135142: PR_ErrorInstallTable (in /usr/lib64/libnspr4.so)

==70015== by 0x111353A8: ??? (in /usr/lib64/libnspr4.so)

==70015== by 0x7E1C0E4: Curl_nss_init (nss.c:1244)

==70015== by 0x7DEF924: curl_global_init (easy.c:239)

==70015== by 0x4FE080: General::CURLInstance::curlGlobalinit()
(CurlClient.cc:103)

Similarly i have several hits for the point 2 back log as well.

Apart from such backtraces i didnt find any valuable leaks in valgrind
which could cause heavy leaks,

Any comments or help would be greatly appreciated .

Thanks

Surya

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-10-05