ElektraInitiative / libelektra

Elektra serves as a universal and secure framework to access configuration settings in a global, hierarchical key database.
https://www.libelektra.org
BSD 3-Clause "New" or "Revised" License
208 stars 123 forks source link

Memleak in crypto_openssl #840

Closed markus2330 closed 8 years ago

markus2330 commented 8 years ago

From http://community.markus-raab.org:8080/job/elektra-clang/

<b>MPK</b> ==3558== 16,384 bytes in 1 blocks are still reachable in loss record 572 of 572
==3558==    at 0x4C2AF2E: realloc (vg_replace_malloc.c:692)
==3558==    by 0x572742F: CRYPTO_realloc (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==3558==    by 0x57B178B: lh_insert (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==3558==    by 0x57B3E69: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==3558==    by 0x57B383A: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==3558==    by 0x6460589: ???
==3558==    by 0x64615A1: ???
==3558==    by 0x504E110: elektraPluginOpen (plugin.c:295)
==3558==    by 0x402138: test_init (test_internals.h:136)
==3558==    by 0x402138: main (testmod_crypto_openssl.c:21)
==3558== 
CYPTO        TESTS
==================

crypto_openssl
markus2330 commented 8 years ago

Do you need an extra issue for

src/plugins/crypto/openssl_operations.c: In function ‘elektraCryptoOpenSSLInit’:
src/plugins/crypto/openssl_operations.c:57:37: warning: unused parameter ‘errorKey’ [-Wunused-parameter]
 int elektraCryptoOpenSSLInit (Key * errorKey)
                                     ^

?

petermax2 commented 8 years ago

Do you need an extra issue for

Nope.

I will continue my work on Elektra after my vacation.

markus2330 commented 8 years ago

Then have a nice vacation!

petermax2 commented 8 years ago

I found 3 leaks in crypto_botan when compiling with clang, but I could not reproduce the leak in crypto_openssl you mentioned above, @markus2330 . The suppressions file seems to cover all leaks in OpenSSL even when using clang.

petermax2 commented 8 years ago

The suppressions file seems to cover all leaks in OpenSSL even when using clang.

Well at least the build server reproduces the error. I will generate the suppressions directly on the build server then.