< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate-users] TLS memory leak of resiprocate 1.7????


The leaks appear to be under SSL_do_handshake and  ERR_clear_error.  As far as I know - neither of the fn's return anything that needs to be free'd by the application.  I suspect the leaks are in OpenSSL 0.9.7a itself - it is a very old release.  Are you able to test with a newer OpenSSL version?

Found this posting on the ERR_get_state this is called from ERR_clear_error that sounds like it could explain one of the leaks:  http://rt.openssl.org/Ticket/Display.html?id=1915&user=guest&pass=guest 

Scott

On Tue, Mar 27, 2012 at 3:54 PM, fuliang yuan <fuliangyuan@xxxxxxxxx> wrote:
Hi,

I used sipp -t tl at 30 calls per second for about 48 hours, the total memory (SIZE) with top command did not change after several hours, but resident memory (RES) increased 2 MBytes for about every 4 hours.  Each incoming call has a new TLS connection.

So I use valgrind to test for 1000 calls at one call per second with answer time 50 seconds, and wait for all call finished and all TLS connection destroyed, and then terminates valgrind. What I found is that some memories in TlsConnection are still reachable although all TLS connections are destroyed.

Is anyone aware of openssl shared lib memory leak ???

Here are some output of valgrind:

==28317== 4 bytes in 1 blocks are still reachable in loss record 12 of 1,937
==28317==    at 0x4004A16: malloc (vg_replace_malloc.c:195)
==28317==    by 0x12C48D: ??? (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12CAB9: CRYPTO_malloc (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x151DA1: OPENSSL_private_rsa_blinding_check_thread_id (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x150125: ??? (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x15182D: RSA_private_decrypt (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x1FB2AD: ??? (in /lib/libssl.so.0.9.7a)
==28317==    by 0x1FCF00: ssl3_accept (in /lib/libssl.so.0.9.7a)
==28317==    by 0x20BDA7: SSL_do_handshake (in /lib/libssl.so.0.9.7a)
==28317==    by 0x83738EA: resip::TlsConnection::checkState() (TlsConnection.cxx:145)
==28317==    by 0x83747C6: resip::TlsConnection::read(char*, int) (TlsConnection.cxx:272)

==28317== 12 bytes in 1 blocks are still reachable in loss record 587 of 1,937
==28317==    at 0x4004A16: malloc (vg_replace_malloc.c:195)
==28317==    by 0x12C48D: ??? (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12CAB9: CRYPTO_malloc (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x17253F: lh_insert (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12D4C9: CRYPTO_dbg_malloc (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12CAE4: CRYPTO_malloc (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x1752F7: ERR_get_state (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x1756C0: ERR_clear_error (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x837366F: resip::TlsConnection::checkState() (TlsConnection.cxx:123)
==28317==    by 0x83747C6: resip::TlsConnection::read(char*, int) (TlsConnection.cxx:272)

==28317== 12 bytes in 1 blocks are still reachable in loss record 590 of 1,937
==28317==    at 0x4004A16: malloc (vg_replace_malloc.c:195)
==28317==    by 0x12C48D: ??? (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12CAB9: CRYPTO_malloc (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12E04A: ??? (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12E355: ??? (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12EA51: CRYPTO_new_ex_data (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x20E29D: SSL_SESSION_new (in /lib/libssl.so.0.9.7a)
==28317==    by 0x20EBD0: ssl_get_new_session (in /lib/libssl.so.0.9.7a)
==28317==    by 0x1FCB4E: ssl3_accept (in /lib/libssl.so.0.9.7a)
==28317==    by 0x20BDA7: SSL_do_handshake (in /lib/libssl.so.0.9.7a)
==28317==    by 0x83738EA: resip::TlsConnection::checkState() (TlsConnection.cxx:145)
==28317==    by 0x83747C6: resip::TlsConnection::read(char*, int) (TlsConnection.cxx:272)

==28317== 12 bytes in 1 blocks are still reachable in loss record 632 of 1,937
==28317==    at 0x4004A16: malloc (vg_replace_malloc.c:195)
==28317==    by 0x12C48D: ??? (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12CAB9: CRYPTO_malloc (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x17253F: lh_insert (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12D683: CRYPTO_dbg_realloc (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x12CB75: CRYPTO_realloc (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x17259F: lh_insert (in /lib/libcrypto.so.0.9.7a)
==28317==    by 0x20E684: SSL_CTX_add_session (in /lib/libssl.so.0.9.7a)
==28317==    by 0x20BB71: ssl_update_cache (in /lib/libssl.so.0.9.7a)
==28317==    by 0x1FE2E1: ssl3_accept (in /lib/libssl.so.0.9.7a)
==28317==    by 0x20BDA7: SSL_do_handshake (in /lib/libssl.so.0.9.7a)
==28317==    by 0x83738EA: resip::TlsConnection::checkState() (TlsConnection.cxx:145)




Any suggestions are appreciated.


Frank





_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/