memory leaks detected using libSSL 1.1

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

memory leaks detected using libSSL 1.1

Michel

Hi,

 

I have multithreaded test programs (client and server) that I use to test some functionalities build with OpenSSL.

They started to warn about memory leaks when I linked them with version 1.1.

As I had to do some code changes to adapt the new version, I first thought I forget some [new] init/free code.

I finally used OPENSSL_cleanup() and alikes instead of the previous litany calls ;-), but still encounters leaks.

As it was hard to track them down, I write a simple server test program that wait for a client and then return without even receiving data.

No certificate are loaded.

Leaks are detected only when a client handshake with the server.

 

I might be wrong, but I do not think this is a false positive.

Could you please have a look at the informations below and share your feelings ?

 

Regards,

 

Michel.

 

Windows _CrtDumpMemoryLeaks() output :

Detected memory leaks!

Dumping objects ->

{4697} normal block at 0x00822660, 140 bytes long.

Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

{4696} normal block at 0x00822608, 24 bytes long.

Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

{4695} normal block at 0x008225B0, 24 bytes long.

Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

{4694} normal block at 0x00822558, 24 bytes long.

Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

{4693} normal block at 0x00822488, 148 bytes long.

Data: <     &  X%   %  > 00 00 00 00 08 26 82 00 58 25 82 00 B0 25 82 00

Object dump complete.

 

 

WARNING: Visual Leak Detector detected memory leaks!

---------- Block 4677 at 0x00822488: 148 bytes ----------

  Leak Hash: 0x76FECFA5, Count: 1, Total 148 bytes

  Call Stack (TID 2904):

    ntdll.dll!RtlAllocateHeap()

    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc() + 0x15 bytes

    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() + 0x9 bytes

    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() + 0x11 bytes

    e:\openssl-1.1.git\crypto\hmac\hmac.c (174): TestsTLS-11.exe!HMAC_CTX_new() + 0xE bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (3060): TestsTLS-11.exe!tls_decrypt_ticket() + 0x5 bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (2994): TestsTLS-11.exe!tls_check_serverhello_tlsext_early() + 0x2F bytes

    e:\openssl-1.1.git\ssl\ssl_sess.c (536): TestsTLS-11.exe!ssl_get_prev_session() + 0x18 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (1181): TestsTLS-11.exe!tls_process_client_hello() + 0x11 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (804): TestsTLS-11.exe!ossl_statem_server_process_message() + 0xD bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (609): TestsTLS-11.exe!read_state_machine() + 0xB bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (429): TestsTLS-11.exe!state_machine() + 0x9 bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (222): TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes

    e:\openssl-1.1.git\ssl\ssl_lib.c (2908): TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes

    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017): TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes

    p:\mes programmes\tests\_testsshared\teststls-11-leak - copie\testtls.cpp (202): TestsTLS-11.exe!main() + 0xB bytes

    f:\dd\vctools\crt\crtw32\startup\crt0.c (165): TestsTLS-11.exe!mainCRTStartup()

 

 

---------- Block 4678 at 0x00822558: 24 bytes ----------

  Leak Hash: 0xEBA79111, Count: 1, Total 24 bytes

  Call Stack (TID 2904):

    ntdll.dll!RtlAllocateHeap()

    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc() + 0x15 bytes

    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() + 0x9 bytes

    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() + 0x11 bytes

    e:\openssl-1.1.git\crypto\evp\digest.c (154): TestsTLS-11.exe!EVP_MD_CTX_new() + 0xB bytes

    e:\openssl-1.1.git\crypto\hmac\hmac.c (210): TestsTLS-11.exe!HMAC_CTX_reset() + 0x5 bytes

    e:\openssl-1.1.git\crypto\hmac\hmac.c (177): TestsTLS-11.exe!HMAC_CTX_new() + 0x9 bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (3060): TestsTLS-11.exe!tls_decrypt_ticket() + 0x5 bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (2994): TestsTLS-11.exe!tls_check_serverhello_tlsext_early() + 0x2F bytes

    e:\openssl-1.1.git\ssl\ssl_sess.c (536): TestsTLS-11.exe!ssl_get_prev_session() + 0x18 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (1181): TestsTLS-11.exe!tls_process_client_hello() + 0x11 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (804): TestsTLS-11.exe!ossl_statem_server_process_message() + 0xD bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (609): TestsTLS-11.exe!read_state_machine() + 0xB bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (429): TestsTLS-11.exe!state_machine() + 0x9 bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (222): TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes

    e:\openssl-1.1.git\ssl\ssl_lib.c (2908): TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes

    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017): TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes

    p:\mes programmes\tests\_testsshared\teststls-11-leak - copie\testtls.cpp (202): TestsTLS-11.exe!main() + 0xB bytes

    f:\dd\vctools\crt\crtw32\startup\crt0.c (165): TestsTLS-11.exe!mainCRTStartup()

 

 

---------- Block 4679 at 0x008225B0: 24 bytes ----------

  Leak Hash: 0x6479AA48, Count: 1, Total 24 bytes

  Call Stack (TID 2904):

    ntdll.dll!RtlAllocateHeap()

    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc() + 0x15 bytes

    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() + 0x9 bytes

    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() + 0x11 bytes

    e:\openssl-1.1.git\crypto\evp\digest.c (154): TestsTLS-11.exe!EVP_MD_CTX_new() + 0xB bytes

    e:\openssl-1.1.git\crypto\hmac\hmac.c (214): TestsTLS-11.exe!HMAC_CTX_reset() + 0x5 bytes

    e:\openssl-1.1.git\crypto\hmac\hmac.c (177): TestsTLS-11.exe!HMAC_CTX_new() + 0x9 bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (3060): TestsTLS-11.exe!tls_decrypt_ticket() + 0x5 bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (2994): TestsTLS-11.exe!tls_check_serverhello_tlsext_early() + 0x2F bytes

    e:\openssl-1.1.git\ssl\ssl_sess.c (536): TestsTLS-11.exe!ssl_get_prev_session() + 0x18 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (1181): TestsTLS-11.exe!tls_process_client_hello() + 0x11 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (804): TestsTLS-11.exe!ossl_statem_server_process_message() + 0xD bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (609): TestsTLS-11.exe!read_state_machine() + 0xB bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (429): TestsTLS-11.exe!state_machine() + 0x9 bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (222): TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes

    e:\openssl-1.1.git\ssl\ssl_lib.c (2908): TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes

    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017): TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes

    p:\mes programmes\tests\_testsshared\teststls-11-leak - copie\testtls.cpp (202): TestsTLS-11.exe!main() + 0xB bytes

    f:\dd\vctools\crt\crtw32\startup\crt0.c (165): TestsTLS-11.exe!mainCRTStartup()

 

 

---------- Block 4680 at 0x00822608: 24 bytes ----------

  Leak Hash: 0x7CF76213, Count: 1, Total 24 bytes

  Call Stack (TID 2904):

    ntdll.dll!RtlAllocateHeap()

    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc() + 0x15 bytes

    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() + 0x9 bytes

    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() + 0x11 bytes

    e:\openssl-1.1.git\crypto\evp\digest.c (154): TestsTLS-11.exe!EVP_MD_CTX_new() + 0xB bytes

    e:\openssl-1.1.git\crypto\hmac\hmac.c (218): TestsTLS-11.exe!HMAC_CTX_reset() + 0x5 bytes

   e:\openssl-1.1.git\crypto\hmac\hmac.c (177): TestsTLS-11.exe!HMAC_CTX_new() + 0x9 bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (3060): TestsTLS-11.exe!tls_decrypt_ticket() + 0x5 bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (2994): TestsTLS-11.exe!tls_check_serverhello_tlsext_early() + 0x2F bytes

    e:\openssl-1.1.git\ssl\ssl_sess.c (536): TestsTLS-11.exe!ssl_get_prev_session() + 0x18 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (1181): TestsTLS-11.exe!tls_process_client_hello() + 0x11 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (804): TestsTLS-11.exe!ossl_statem_server_process_message() + 0xD bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (609): TestsTLS-11.exe!read_state_machine() + 0xB bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (429): TestsTLS-11.exe!state_machine() + 0x9 bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (222): TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes

    e:\openssl-1.1.git\ssl\ssl_lib.c (2908): TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes

    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017): TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes

    p:\mes programmes\tests\_testsshared\teststls-11-leak - copie\testtls.cpp (202): TestsTLS-11.exe!main() + 0xB bytes

    f:\dd\vctools\crt\crtw32\startup\crt0.c (165): TestsTLS-11.exe!mainCRTStartup()

 

 

---------- Block 4681 at 0x00822660: 140 bytes ----------

  Leak Hash: 0x86320408, Count: 1, Total 140 bytes

  Call Stack (TID 2904):

    ntdll.dll!RtlAllocateHeap()

    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc() + 0x15 bytes

    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() + 0x9 bytes

    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() + 0x11 bytes

    e:\openssl-1.1.git\crypto\evp\evp_enc.c (95): TestsTLS-11.exe!EVP_CIPHER_CTX_new() + 0xE bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (3063): TestsTLS-11.exe!tls_decrypt_ticket() + 0x5 bytes

    e:\openssl-1.1.git\ssl\t1_lib.c (2994): TestsTLS-11.exe!tls_check_serverhello_tlsext_early() + 0x2F bytes

    e:\openssl-1.1.git\ssl\ssl_sess.c (536): TestsTLS-11.exe!ssl_get_prev_session() + 0x18 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (1181): TestsTLS-11.exe!tls_process_client_hello() + 0x11 bytes

    e:\openssl-1.1.git\ssl\statem\statem_srvr.c (804): TestsTLS-11.exe!ossl_statem_server_process_message() + 0xD bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (609): TestsTLS-11.exe!read_state_machine() + 0xB bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (429): TestsTLS-11.exe!state_machine() + 0x9 bytes

    e:\openssl-1.1.git\ssl\statem\statem.c (222): TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes

    e:\openssl-1.1.git\ssl\ssl_lib.c (2908): TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes

    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017): TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes

    p:\mes programmes\tests\_testsshared\teststls-11-leak - copie\testtls.cpp (202): TestsTLS-11.exe!main() + 0xB bytes

    f:\dd\vctools\crt\crtw32\startup\crt0.c (165): TestsTLS-11.exe!mainCRTStartup()

 

 

Visual Leak Detector detected 5 memory leaks (10545 bytes).

Largest number used: 138152 bytes.

Total allocations: 611193 bytes.

Visual Leak Detector is now exiting.


--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Matt Caswell-2


On 13/02/16 22:19, Michel wrote:

> Hi,
>
>  
>
> I have multithreaded test programs (client and server) that I use to
> test some functionalities build with OpenSSL.
>
> They started to warn about memory leaks when I linked them with version 1.1.
>
> As I had to do some code changes to adapt the new version, I first
> thought I forget some [new] init/free code.
>
> I finally used OPENSSL_cleanup() and alikes instead of the previous
> litany calls ;-), but still encounters leaks.
>
> As it was hard to track them down, I write a simple server test program
> that wait for a client and then return without even receiving data.
>
> No certificate are loaded.
>
> Leaks are detected only when a client handshake with the server.
>
>  
>
> I might be wrong, but I do not think this is a false positive.
>
> Could you please have a look at the informations below and share your
> feelings ?
Hmmm. It does look to me like there could be a memory leak here. What's
not clear to me is to why you are only seeing this in 1.1 and not
previous versions, as it looks like the same could happen in 1.0.2 as well!

Anyway, please try the attached patch to see if that helps.

Let me know how you get on.

Thanks

Matt


--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

tls_decrypt_ticket.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Michel
Hi Matt,

Thanks for your quick answer.
I applied your patch and it fixes the leaks found in the simple test
program.

However, a more complex one, still report [other] leaks.

Below is a new log if you can have a look at them.
I will investigate deeper tomorrow concering 1.0.2.

Thanks again,

Michel.

Detected memory leaks!
Dumping objects ->
{4383} normal block at 0x006472C8, 8 bytes long.
 Data: <        > 00 00 00 00 01 00 00 00
{4381} normal block at 0x00646B48, 12 bytes long.
 Data: < od      }  > D8 6F 64 00 00 00 00 00 20 7D 00 00
{4379} normal block at 0x00647248, 64 bytes long.
 Data: <Hkd             > 48 6B 64 00 00 00 00 00 00 00 00 00 00 00 00 00
{4377} normal block at 0x006471A8, 96 bytes long.
 Data: <Hrd     0       > 48 72 64 00 10 03 A5 00 30 03 A5 00 08 00 00 00
{4375} normal block at 0x00646FD8, 400 bytes long.
 Data: <                > 00 00 00 00 A0 09 00 00 00 00 00 00 00 00 00 00
Object dump complete.

WARNING: Visual Leak Detector detected memory leaks!
---------- Block 4363 at 0x00646B48: 12 bytes ----------
  Leak Hash: 0xF7E93E2A, Count: 1, Total 12 bytes
  Call Stack (TID 2464):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (168):
TestsTLS-11.exe!lh_insert() + 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_insert() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (371):
TestsTLS-11.exe!int_thread_set_item() + 0xD bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()

---------- Block 4357 at 0x00646FD8: 400 bytes ----------
  Leak Hash: 0xC22F7275, Count: 1, Total 400 bytes
  Call Stack (TID 2464):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (874):
TestsTLS-11.exe!ERR_get_state() + 0xE bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()

---------- Block 4359 at 0x006471A8: 96 bytes ----------
  Leak Hash: 0x1DBDD4B0, Count: 1, Total 96 bytes
  Call Stack (TID 2464):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (116): TestsTLS-11.exe!lh_new()
+ 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (321):
TestsTLS-11.exe!int_thread_get() + 0xF bytes
    e:\openssl-1.1.git\crypto\err\err.c (369):
TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()

---------- Block 4361 at 0x00647248: 64 bytes ----------
  Leak Hash: 0x713FD291, Count: 1, Total 64 bytes
  Call Stack (TID 2464):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (118): TestsTLS-11.exe!lh_new()
+ 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (321):
TestsTLS-11.exe!int_thread_get() + 0xF bytes
    e:\openssl-1.1.git\crypto\err\err.c (369):
TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()

---------- Block 4365 at 0x006472C8: 8 bytes ----------
  Leak Hash: 0xFBE574AD, Count: 1, Total 8 bytes
  Call Stack (TID 2464):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\init.c (197):
TestsTLS-11.exe!ossl_init_get_thread_local() + 0xB bytes
    e:\openssl-1.1.git\crypto\init.c (511):
TestsTLS-11.exe!ossl_init_thread_start() + 0x7 bytes
    e:\openssl-1.1.git\crypto\err\err.c (898):
TestsTLS-11.exe!ERR_get_state() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()

Visual Leak Detector detected 5 memory leaks (10757 bytes).
Largest number used: 213916 bytes.
Total allocations: 902180 bytes.
Visual Leak Detector is now exiting.

-----Message d'origine-----
De : openssl-dev [mailto:[hidden email]] De la part de Matt
Caswell
Envoyé : dimanche 14 février 2016 00:30
À : [hidden email]
Objet : Re: [openssl-dev] memory leaks detected using libSSL 1.1

Hmmm. It does look to me like there could be a memory leak here. What's not
clear to me is to why you are only seeing this in 1.1 and not previous
versions, as it looks like the same could happen in 1.0.2 as well!

Anyway, please try the attached patch to see if that helps.

Let me know how you get on.

Thanks

Matt


--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Matt Caswell-2


On 14/02/16 00:11, Michel wrote:

> Hi Matt,
>
> Thanks for your quick answer.
> I applied your patch and it fixes the leaks found in the simple test
> program.
>
> However, a more complex one, still report [other] leaks.
>
> Below is a new log if you can have a look at them.
> I will investigate deeper tomorrow concering 1.0.2.

Are you linking to OpenSSL statically?

Please see the "Notes" section on this page:
https://www.openssl.org/docs/manmaster/crypto/OPENSSL_atexit.html

Matt



>
> Thanks again,
>
> Michel.
>
> Detected memory leaks!
> Dumping objects ->
> {4383} normal block at 0x006472C8, 8 bytes long.
>  Data: <        > 00 00 00 00 01 00 00 00
> {4381} normal block at 0x00646B48, 12 bytes long.
>  Data: < od      }  > D8 6F 64 00 00 00 00 00 20 7D 00 00
> {4379} normal block at 0x00647248, 64 bytes long.
>  Data: <Hkd             > 48 6B 64 00 00 00 00 00 00 00 00 00 00 00 00 00
> {4377} normal block at 0x006471A8, 96 bytes long.
>  Data: <Hrd     0       > 48 72 64 00 10 03 A5 00 30 03 A5 00 08 00 00 00
> {4375} normal block at 0x00646FD8, 400 bytes long.
>  Data: <                > 00 00 00 00 A0 09 00 00 00 00 00 00 00 00 00 00
> Object dump complete.
>
> WARNING: Visual Leak Detector detected memory leaks!
> ---------- Block 4363 at 0x00646B48: 12 bytes ----------
>   Leak Hash: 0xF7E93E2A, Count: 1, Total 12 bytes
>   Call Stack (TID 2464):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (168):
> TestsTLS-11.exe!lh_insert() + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_insert() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (371):
> TestsTLS-11.exe!int_thread_set_item() + 0xD bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
> ---------- Block 4357 at 0x00646FD8: 400 bytes ----------
>   Leak Hash: 0xC22F7275, Count: 1, Total 400 bytes
>   Call Stack (TID 2464):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (874):
> TestsTLS-11.exe!ERR_get_state() + 0xE bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
> ---------- Block 4359 at 0x006471A8: 96 bytes ----------
>   Leak Hash: 0x1DBDD4B0, Count: 1, Total 96 bytes
>   Call Stack (TID 2464):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (116): TestsTLS-11.exe!lh_new()
> + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (321):
> TestsTLS-11.exe!int_thread_get() + 0xF bytes
>     e:\openssl-1.1.git\crypto\err\err.c (369):
> TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
> ---------- Block 4361 at 0x00647248: 64 bytes ----------
>   Leak Hash: 0x713FD291, Count: 1, Total 64 bytes
>   Call Stack (TID 2464):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (118): TestsTLS-11.exe!lh_new()
> + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (321):
> TestsTLS-11.exe!int_thread_get() + 0xF bytes
>     e:\openssl-1.1.git\crypto\err\err.c (369):
> TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
> ---------- Block 4365 at 0x006472C8: 8 bytes ----------
>   Leak Hash: 0xFBE574AD, Count: 1, Total 8 bytes
>   Call Stack (TID 2464):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\init.c (197):
> TestsTLS-11.exe!ossl_init_get_thread_local() + 0xB bytes
>     e:\openssl-1.1.git\crypto\init.c (511):
> TestsTLS-11.exe!ossl_init_thread_start() + 0x7 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (898):
> TestsTLS-11.exe!ERR_get_state() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (1017):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11-leak\clttasks.cpp (63):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
> Visual Leak Detector detected 5 memory leaks (10757 bytes).
> Largest number used: 213916 bytes.
> Total allocations: 902180 bytes.
> Visual Leak Detector is now exiting.
>
> -----Message d'origine-----
> De : openssl-dev [mailto:[hidden email]] De la part de Matt
> Caswell
> Envoyé : dimanche 14 février 2016 00:30
> À : [hidden email]
> Objet : Re: [openssl-dev] memory leaks detected using libSSL 1.1
>
> Hmmm. It does look to me like there could be a memory leak here. What's not
> clear to me is to why you are only seeing this in 1.1 and not previous
> versions, as it looks like the same could happen in 1.0.2 as well!
>
> Anyway, please try the attached patch to see if that helps.
>
> Let me know how you get on.
>
> Thanks
>
> Matt
>
>
--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Michel
Hi Matt,

Yes I am linking statically and I read the man about OPENSSL_init_crypto(),
thanks.
However I still have leaks reported.
:-(

What I have changed to adapt to v1.1 is calling OPENSSL_thread_stop() in
each thread before it leaves,
instead of ERR_remove_thread_state( NULL ),
and I am calling OPENSSL_cleanup() before the main thread returns.
Am I missing anything else ?

Now I have 2 tests programs, almost identical, one is linked against v1.0.2
and the other against v1.1.
The former (1.0.2) doesn't report any leak but the later (1.1) always report
leaks.

I tried lots of modifications to the 1.1 version in order to understand what
is happening,
but the only thing I noticed is leaks occur if at some point the program go
to the OpenSSL error subsystem,
like in the 2 reports below.

Can you please help in this matter ?

Detected memory leaks!
Dumping objects ->
{7453} normal block at 0x00895440, 8 bytes long.
 Data: <        > 00 00 00 00 01 00 00 00
{5460} normal block at 0x00871B98, 12 bytes long.
 Data: <         e  > C8 19 87 00 00 00 00 00 B4 65 01 00
{5459} normal block at 0x008719C8, 400 bytes long.
 Data: <                > 00 00 00 00 84 1B 00 00 00 00 00 00 00 00 00 00
{5457} normal block at 0x00871900, 64 bytes long.
 Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
{5455} normal block at 0x0086D7E8, 96 bytes long.
 Data: <    `           > 00 19 87 00 60 CB 05 01 80 CB 05 01 08 00 00 00
Object dump complete.

WARNING: Visual Leak Detector detected memory leaks!
---------- Block 5450 at 0x0086D7E8: 96 bytes ----------
  Leak Hash: 0xE1A21867, Count: 1, Total 96 bytes
  Call Stack (TID 6956):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (116): TestsTLS-11.exe!lh_new()
+ 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (321):
TestsTLS-11.exe!int_thread_get() + 0xF bytes
    e:\openssl-1.1.git\crypto\err\err.c (369):
TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (581):
TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
    e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
    e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (249):
TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (113):
TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
    e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\tlscltsetup.cpp (99):
TestsTLS-11.exe!TLSCltConfig::Setup() + 0x26 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (90):
TestsTLS-11.exe!CltThread::Main() + 0x17 bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 5452 at 0x00871900: 64 bytes ----------
  Leak Hash: 0x188D6136, Count: 1, Total 64 bytes
  Call Stack (TID 6956):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (118): TestsTLS-11.exe!lh_new()
+ 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (321):
TestsTLS-11.exe!int_thread_get() + 0xF bytes
    e:\openssl-1.1.git\crypto\err\err.c (369):
TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (581):
TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
    e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
    e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (249):
TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (113):
TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
    e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\tlscltsetup.cpp (99):
TestsTLS-11.exe!TLSCltConfig::Setup() + 0x26 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (90):
TestsTLS-11.exe!CltThread::Main() + 0x17 bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 5454 at 0x008719C8: 400 bytes ----------
  Leak Hash: 0x21826292, Count: 1, Total 400 bytes
  Call Stack (TID 7044):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (874):
TestsTLS-11.exe!ERR_get_state() + 0xE bytes
    e:\openssl-1.1.git\crypto\err\err.c (581):
TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
    e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
    e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (249):
TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (113):
TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
    e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\tlssrvsetup.cpp (214):
TestsTLS-11.exe!TLSSrvConfig::Setup() + 0x26 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (103):
TestsTLS-11.exe!SrvThread::Main() + 0x17 bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 5455 at 0x00871B98: 12 bytes ----------
  Leak Hash: 0x6B9B46D4, Count: 1, Total 12 bytes
  Call Stack (TID 7044):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (168):
TestsTLS-11.exe!lh_insert() + 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_insert() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (371):
TestsTLS-11.exe!int_thread_set_item() + 0xD bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (581):
TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
    e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
    e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (249):
TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (113):
TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
    e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\tlssrvsetup.cpp (214):
TestsTLS-11.exe!TLSSrvConfig::Setup() + 0x26 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (103):
TestsTLS-11.exe!SrvThread::Main() + 0x17 bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 7448 at 0x00895440: 8 bytes ----------
  Leak Hash: 0x977858EE, Count: 1, Total 8 bytes
  Call Stack (TID 7044):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\init.c (198):
TestsTLS-11.exe!ossl_init_get_thread_local() + 0xB bytes
    e:\openssl-1.1.git\crypto\init.c (512):
TestsTLS-11.exe!ossl_init_thread_start() + 0x7 bytes
    e:\openssl-1.1.git\crypto\err\err.c (898):
TestsTLS-11.exe!ERR_get_state() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (581):
TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
    e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
    e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (249):
TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\by_file.c (113):
TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
    e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
    e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\tlssrvsetup.cpp (214):
TestsTLS-11.exe!TLSSrvConfig::Setup() + 0x26 bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (103):
TestsTLS-11.exe!SrvThread::Main() + 0x17 bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()

or another example :

Detected memory leaks!
Dumping objects ->
{7105} normal block at 0x00484A40, 8 bytes long.
 Data: <        > 00 00 00 00 01 00 00 00
{5112} normal block at 0x004601D8, 12 bytes long.
 Data: <  F     hE  > 08 00 46 00 00 00 00 00 68 45 01 00
{5110} normal block at 0x0045FEC0, 64 bytes long.
 Data: <  F             > D8 01 46 00 00 00 00 00 00 00 00 00 00 00 00 00
{5109} normal block at 0x0045FE20, 96 bytes long.
 Data: <  E @ P ` P     > C0 FE 45 00 40 D3 50 01 60 D3 50 01 08 00 00 00
{5108} normal block at 0x00460008, 400 bytes long.
 Data: <                > 00 00 00 00 08 19 00 00 00 00 00 00 00 00 00 00
Object dump complete.

WARNING: Visual Leak Detector detected memory leaks!
---------- Block 5097 at 0x0045FE20: 96 bytes ----------
  Leak Hash: 0xB3142E7A, Count: 1, Total 96 bytes
  Call Stack (TID 6396):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (116): TestsTLS-11.exe!lh_new()
+ 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (321):
TestsTLS-11.exe!int_thread_get() + 0xF bytes
    e:\openssl-1.1.git\crypto\err\err.c (369):
TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (64):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 5098 at 0x0045FEC0: 64 bytes ----------
  Leak Hash: 0xDF96285B, Count: 1, Total 64 bytes
  Call Stack (TID 6396):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (118): TestsTLS-11.exe!lh_new()
+ 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (321):
TestsTLS-11.exe!int_thread_get() + 0xF bytes
    e:\openssl-1.1.git\crypto\err\err.c (369):
TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (64):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 5096 at 0x00460008: 400 bytes ----------
  Leak Hash: 0xC49DE418, Count: 1, Total 400 bytes
  Call Stack (TID 6408):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (874):
TestsTLS-11.exe!ERR_get_state() + 0xE bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (222):
TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 5100 at 0x004601D8: 12 bytes ----------
  Leak Hash: 0x8F14E2A9, Count: 1, Total 12 bytes
  Call Stack (TID 6408):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (168):
TestsTLS-11.exe!lh_insert() + 0xB bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_insert() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (371):
TestsTLS-11.exe!int_thread_set_item() + 0xD bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (222):
TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 7093 at 0x00484A40: 8 bytes ----------
  Leak Hash: 0x160A9734, Count: 1, Total 8 bytes
  Call Stack (TID 6408):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\init.c (198):
TestsTLS-11.exe!ossl_init_get_thread_local() + 0xB bytes
    e:\openssl-1.1.git\crypto\init.c (512):
TestsTLS-11.exe!ossl_init_thread_start() + 0x7 bytes
    e:\openssl-1.1.git\crypto\err\err.c (898):
TestsTLS-11.exe!ERR_get_state() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (222):
TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()

-----Message d'origine-----
De : openssl-dev [mailto:[hidden email]] De la part de Matt
Caswell
Envoyé : mardi 16 février 2016 00:15
À : [hidden email]
Objet : Re: [openssl-dev] memory leaks detected using libSSL 1.1

Are you linking to OpenSSL statically?

Please see the "Notes" section on this page:
https://www.openssl.org/docs/manmaster/crypto/OPENSSL_atexit.html

Matt

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Matt Caswell-2


On 16/02/16 23:25, Michel wrote:

> Hi Matt,
>
> Yes I am linking statically and I read the man about OPENSSL_init_crypto(),
> thanks.
> However I still have leaks reported.
> :-(
>
> What I have changed to adapt to v1.1 is calling OPENSSL_thread_stop() in
> each thread before it leaves,
> instead of ERR_remove_thread_state( NULL ),
> and I am calling OPENSSL_cleanup() before the main thread returns.
> Am I missing anything else ?

That should be sufficient (although the OPENSSL_cleanup() should not be
required).

You could try compiling OpenSSL with OPENSSL_INIT_DEBUG defined, e.g.

perl Configure your-platform-here -DOPENSSL_INIT_DEBUG

This should print out some debugging information to stderr every time
the init functions attempt to do something interesting. In particular
when you call OPENSSL_thread_stop() you should see the following printed
out:

OPENSSL_INIT: ossl_init_thread_stop: ERR_remove_thread_state(NULL)

Matt

>
> Now I have 2 tests programs, almost identical, one is linked against v1.0.2
> and the other against v1.1.
> The former (1.0.2) doesn't report any leak but the later (1.1) always report
> leaks.
>
> I tried lots of modifications to the 1.1 version in order to understand what
> is happening,
> but the only thing I noticed is leaks occur if at some point the program go
> to the OpenSSL error subsystem,
> like in the 2 reports below.
>
> Can you please help in this matter ?
>
> Detected memory leaks!
> Dumping objects ->
> {7453} normal block at 0x00895440, 8 bytes long.
>  Data: <        > 00 00 00 00 01 00 00 00
> {5460} normal block at 0x00871B98, 12 bytes long.
>  Data: <         e  > C8 19 87 00 00 00 00 00 B4 65 01 00
> {5459} normal block at 0x008719C8, 400 bytes long.
>  Data: <                > 00 00 00 00 84 1B 00 00 00 00 00 00 00 00 00 00
> {5457} normal block at 0x00871900, 64 bytes long.
>  Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> {5455} normal block at 0x0086D7E8, 96 bytes long.
>  Data: <    `           > 00 19 87 00 60 CB 05 01 80 CB 05 01 08 00 00 00
> Object dump complete.
>
> WARNING: Visual Leak Detector detected memory leaks!
> ---------- Block 5450 at 0x0086D7E8: 96 bytes ----------
>   Leak Hash: 0xE1A21867, Count: 1, Total 96 bytes
>   Call Stack (TID 6956):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (116): TestsTLS-11.exe!lh_new()
> + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (321):
> TestsTLS-11.exe!int_thread_get() + 0xF bytes
>     e:\openssl-1.1.git\crypto\err\err.c (369):
> TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (581):
> TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
> TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
> TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (249):
> TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (113):
> TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
> TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
>     e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
> TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
> TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
> TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\tlscltsetup.cpp (99):
> TestsTLS-11.exe!TLSCltConfig::Setup() + 0x26 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (90):
> TestsTLS-11.exe!CltThread::Main() + 0x17 bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 5452 at 0x00871900: 64 bytes ----------
>   Leak Hash: 0x188D6136, Count: 1, Total 64 bytes
>   Call Stack (TID 6956):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (118): TestsTLS-11.exe!lh_new()
> + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (321):
> TestsTLS-11.exe!int_thread_get() + 0xF bytes
>     e:\openssl-1.1.git\crypto\err\err.c (369):
> TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (581):
> TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
> TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
> TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (249):
> TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (113):
> TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
> TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
>     e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
> TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
> TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
> TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\tlscltsetup.cpp (99):
> TestsTLS-11.exe!TLSCltConfig::Setup() + 0x26 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (90):
> TestsTLS-11.exe!CltThread::Main() + 0x17 bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 5454 at 0x008719C8: 400 bytes ----------
>   Leak Hash: 0x21826292, Count: 1, Total 400 bytes
>   Call Stack (TID 7044):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (874):
> TestsTLS-11.exe!ERR_get_state() + 0xE bytes
>     e:\openssl-1.1.git\crypto\err\err.c (581):
> TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
> TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
> TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (249):
> TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (113):
> TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
> TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
>     e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
> TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
> TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
> TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\tlssrvsetup.cpp (214):
> TestsTLS-11.exe!TLSSrvConfig::Setup() + 0x26 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (103):
> TestsTLS-11.exe!SrvThread::Main() + 0x17 bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 5455 at 0x00871B98: 12 bytes ----------
>   Leak Hash: 0x6B9B46D4, Count: 1, Total 12 bytes
>   Call Stack (TID 7044):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (168):
> TestsTLS-11.exe!lh_insert() + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_insert() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (371):
> TestsTLS-11.exe!int_thread_set_item() + 0xD bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (581):
> TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
> TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
> TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (249):
> TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (113):
> TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
> TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
>     e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
> TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
> TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
> TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\tlssrvsetup.cpp (214):
> TestsTLS-11.exe!TLSSrvConfig::Setup() + 0x26 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (103):
> TestsTLS-11.exe!SrvThread::Main() + 0x17 bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 7448 at 0x00895440: 8 bytes ----------
>   Leak Hash: 0x977858EE, Count: 1, Total 8 bytes
>   Call Stack (TID 7044):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\init.c (198):
> TestsTLS-11.exe!ossl_init_get_thread_local() + 0xB bytes
>     e:\openssl-1.1.git\crypto\init.c (512):
> TestsTLS-11.exe!ossl_init_thread_start() + 0x7 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (898):
> TestsTLS-11.exe!ERR_get_state() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (581):
> TestsTLS-11.exe!ERR_put_error() + 0x5 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_lib.c (702):
> TestsTLS-11.exe!PEM_read_bio() + 0x15 bytes
>     e:\openssl-1.1.git\crypto\pem\pem_info.c (117):
> TestsTLS-11.exe!PEM_X509_INFO_read_bio() + 0x19 bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (249):
> TestsTLS-11.exe!X509_load_cert_crl_file() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\by_file.c (113):
> TestsTLS-11.exe!by_file_ctrl() + 0xF bytes
>     e:\openssl-1.1.git\crypto\x509\x509_lu.c (117):
> TestsTLS-11.exe!X509_LOOKUP_ctrl() + 0x1F bytes
>     e:\openssl-1.1.git\crypto\x509\x509_d2.c (92):
> TestsTLS-11.exe!X509_STORE_load_locations() + 0x13 bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (3344):
> TestsTLS-11.exe!SSL_CTX_load_verify_locations() + 0x14 bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (410):
> TestsTLS-11.exe!OTLS::TLSCtx::LoadTrustedCertsFile() + 0x12 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\tlssrvsetup.cpp (214):
> TestsTLS-11.exe!TLSSrvConfig::Setup() + 0x26 bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (103):
> TestsTLS-11.exe!SrvThread::Main() + 0x17 bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
> or another example :
>
> Detected memory leaks!
> Dumping objects ->
> {7105} normal block at 0x00484A40, 8 bytes long.
>  Data: <        > 00 00 00 00 01 00 00 00
> {5112} normal block at 0x004601D8, 12 bytes long.
>  Data: <  F     hE  > 08 00 46 00 00 00 00 00 68 45 01 00
> {5110} normal block at 0x0045FEC0, 64 bytes long.
>  Data: <  F             > D8 01 46 00 00 00 00 00 00 00 00 00 00 00 00 00
> {5109} normal block at 0x0045FE20, 96 bytes long.
>  Data: <  E @ P ` P     > C0 FE 45 00 40 D3 50 01 60 D3 50 01 08 00 00 00
> {5108} normal block at 0x00460008, 400 bytes long.
>  Data: <                > 00 00 00 00 08 19 00 00 00 00 00 00 00 00 00 00
> Object dump complete.
>
> WARNING: Visual Leak Detector detected memory leaks!
> ---------- Block 5097 at 0x0045FE20: 96 bytes ----------
>   Leak Hash: 0xB3142E7A, Count: 1, Total 96 bytes
>   Call Stack (TID 6396):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (116): TestsTLS-11.exe!lh_new()
> + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (321):
> TestsTLS-11.exe!int_thread_get() + 0xF bytes
>     e:\openssl-1.1.git\crypto\err\err.c (369):
> TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (64):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 5098 at 0x0045FEC0: 64 bytes ----------
>   Leak Hash: 0xDF96285B, Count: 1, Total 64 bytes
>   Call Stack (TID 6396):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (118): TestsTLS-11.exe!lh_new()
> + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (321):
> TestsTLS-11.exe!int_thread_get() + 0xF bytes
>     e:\openssl-1.1.git\crypto\err\err.c (369):
> TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (64):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 5096 at 0x00460008: 400 bytes ----------
>   Leak Hash: 0xC49DE418, Count: 1, Total 400 bytes
>   Call Stack (TID 6408):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (874):
> TestsTLS-11.exe!ERR_get_state() + 0xE bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (222):
> TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
> TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 5100 at 0x004601D8: 12 bytes ----------
>   Leak Hash: 0x8F14E2A9, Count: 1, Total 12 bytes
>   Call Stack (TID 6408):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (168):
> TestsTLS-11.exe!lh_insert() + 0xB bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_insert() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (371):
> TestsTLS-11.exe!int_thread_set_item() + 0xD bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (222):
> TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
> TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 7093 at 0x00484A40: 8 bytes ----------
>   Leak Hash: 0x160A9734, Count: 1, Total 8 bytes
>   Call Stack (TID 6408):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (138): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (158): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\init.c (198):
> TestsTLS-11.exe!ossl_init_get_thread_local() + 0xB bytes
>     e:\openssl-1.1.git\crypto\init.c (512):
> TestsTLS-11.exe!ossl_init_thread_start() + 0x7 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (898):
> TestsTLS-11.exe!ERR_get_state() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (222):
> TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2908):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
> TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
> -----Message d'origine-----
> De : openssl-dev [mailto:[hidden email]] De la part de Matt
> Caswell
> Envoyé : mardi 16 février 2016 00:15
> À : [hidden email]
> Objet : Re: [openssl-dev] memory leaks detected using libSSL 1.1
>
> Are you linking to OpenSSL statically?
>
> Please see the "Notes" section on this page:
> https://www.openssl.org/docs/manmaster/crypto/OPENSSL_atexit.html
>
> Matt
>
--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Michel
Hi Matt,

Thanks for the suggestion.

This is what was printed to stderr :
OPENSSL_INIT: ossl_init_base: Setting up stop handlers
OPENSSL_INIT: ossl_init_add_all_ciphers: openssl_add_all_ciphers_internal()
OPENSSL_INIT: ossl_init_add_all_digests: openssl_add_all_digests_internal()
OPENSSL_INIT: ossl_init_ssl_base: Adding SSL ciphers and digests
OPENSSL_INIT: ossl_init_ssl_base: SSL_COMP_get_compression_methods()
OPENSSL_INIT: ossl_init_ssl_base: SSL_add_ssl_module()
OPENSSL_INIT: ossl_init_load_ssl_strings: ERR_load_SSL_strings()
OPENSSL_INIT: ossl_init_async: async_init()
OPENSSL_INIT: ossl_init_load_crypto_strings:
err_load_crypto_strings_intern()
OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state
OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state
OPENSSL_INIT: ossl_init_thread_stop: ERR_remove_thread_state(NULL)
OPENSSL_INIT: ssl_library_stop: SSL_COMP_free_compression_methods()
OPENSSL_INIT: ssl_library_stop: ERR_free_strings()
OPENSSL_INIT: OPENSSL_cleanup: ERR_free_strings()
OPENSSL_INIT: OPENSSL_INIT_library_stop: CRYPTO_cleanup_all_ex_data()
OPENSSL_INIT: OPENSSL_INIT_library_stop: EVP_cleanup()
OPENSSL_INIT: OPENSSL_INIT_library_stop: CONF_modules_free()
OPENSSL_INIT: OPENSSL_INIT_library_stop: RAND_cleanup()

Shouldn't there be at least another line with ERR_remove_thread_state() (one
for each thread) ?
This test program launch 1 server thread and 1 client thread.
Both of them have OPENSSL_thread_stop() in their [pre-]exit member function.

Michel.

-----Message d'origine-----
De : openssl-dev [mailto:[hidden email]] De la part de Matt
Caswell
Envoyé : mercredi 17 février 2016 17:23
À : [hidden email]
Objet : Re: [openssl-dev] memory leaks detected using libSSL 1.1

> Am I missing anything else ?

That should be sufficient (although the OPENSSL_cleanup() should not be
required).

You could try compiling OpenSSL with OPENSSL_INIT_DEBUG defined, e.g.

perl Configure your-platform-here -DOPENSSL_INIT_DEBUG

This should print out some debugging information to stderr every time the
init functions attempt to do something interesting. In particular when you
call OPENSSL_thread_stop() you should see the following printed
out:

OPENSSL_INIT: ossl_init_thread_stop: ERR_remove_thread_state(NULL)

Matt

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Matt Caswell-2


On 18/02/16 00:13, Michel wrote:

> Hi Matt,
>
> Thanks for the suggestion.
>
> This is what was printed to stderr :
> OPENSSL_INIT: ossl_init_base: Setting up stop handlers
> OPENSSL_INIT: ossl_init_add_all_ciphers: openssl_add_all_ciphers_internal()
> OPENSSL_INIT: ossl_init_add_all_digests: openssl_add_all_digests_internal()
> OPENSSL_INIT: ossl_init_ssl_base: Adding SSL ciphers and digests
> OPENSSL_INIT: ossl_init_ssl_base: SSL_COMP_get_compression_methods()
> OPENSSL_INIT: ossl_init_ssl_base: SSL_add_ssl_module()
> OPENSSL_INIT: ossl_init_load_ssl_strings: ERR_load_SSL_strings()
> OPENSSL_INIT: ossl_init_async: async_init()
> OPENSSL_INIT: ossl_init_load_crypto_strings:
> err_load_crypto_strings_intern()
> OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state
> OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state
> OPENSSL_INIT: ossl_init_thread_stop: ERR_remove_thread_state(NULL)
> OPENSSL_INIT: ssl_library_stop: SSL_COMP_free_compression_methods()
> OPENSSL_INIT: ssl_library_stop: ERR_free_strings()
> OPENSSL_INIT: OPENSSL_cleanup: ERR_free_strings()
> OPENSSL_INIT: OPENSSL_INIT_library_stop: CRYPTO_cleanup_all_ex_data()
> OPENSSL_INIT: OPENSSL_INIT_library_stop: EVP_cleanup()
> OPENSSL_INIT: OPENSSL_INIT_library_stop: CONF_modules_free()
> OPENSSL_INIT: OPENSSL_INIT_library_stop: RAND_cleanup()
>
> Shouldn't there be at least another line with ERR_remove_thread_state() (one
> for each thread) ?
Yes. I can see we have two of these:

OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state
OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state

Which means that the init code has spotted that there are two threads
running and has initialised the error system for both of them.

But we only get one of these:

OPENSSL_INIT: ossl_init_thread_stop: ERR_remove_thread_state(NULL)

Which means only one of the two threads has subsequently been de-inited.
That's very odd.

I have two possible theories:
1) OPENSSL_thread_stop() is not actually getting called as we think it is.
Or
2) The Thread Local Structure that keeps track of what things need
cleanup is not being obtained correctly for some reason during the
thread stop...so we have "forgotten" that we initialised the error system.

To try and help narrow down which of these possibilities it is I have
created a patch (attached) which bumps up the logging significantly.
Please can you apply it, rerun your code (with OPENSSL_INIT_DEBUG
defined still) and post the output here?

Thanks

Matt


> This test program launch 1 server thread and 1 client thread.
> Both of them have OPENSSL_thread_stop() in their [pre-]exit member function.
>
> Michel.
>
> -----Message d'origine-----
> De : openssl-dev [mailto:[hidden email]] De la part de Matt
> Caswell
> Envoyé : mercredi 17 février 2016 17:23
> À : [hidden email]
> Objet : Re: [openssl-dev] memory leaks detected using libSSL 1.1
>
>> Am I missing anything else ?
>
> That should be sufficient (although the OPENSSL_cleanup() should not be
> required).
>
> You could try compiling OpenSSL with OPENSSL_INIT_DEBUG defined, e.g.
>
> perl Configure your-platform-here -DOPENSSL_INIT_DEBUG
>
> This should print out some debugging information to stderr every time the
> init functions attempt to do something interesting. In particular when you
> call OPENSSL_thread_stop() you should see the following printed
> out:
>
> OPENSSL_INIT: ossl_init_thread_stop: ERR_remove_thread_state(NULL)
>
> Matt
>

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

thread-stop-debug.patch (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Michel
Hi Matt,

Here under is the new results after applying your patch.
Let me know anything I could do to investigate deeper.

Regards,

Michel.

Thread serveur 5324 demarre
Thread client 6348 demarre
OPENSSL_INIT: ossl_init_base: Setting up stop handlers
OPENSSL_INIT: ossl_init_add_all_ciphers: openssl_add_all_ciphers_internal()
OPENSSL_INIT: ossl_init_add_all_digests: openssl_add_all_digests_internal()
OPENSSL_INIT: ossl_init_ssl_base: Adding SSL ciphers and digests
OPENSSL_INIT: ossl_init_ssl_base: SSL_COMP_get_compression_methods()
OPENSSL_INIT: ossl_init_ssl_base: SSL_add_ssl_module()
OPENSSL_INIT: ossl_init_load_ssl_strings: ERR_load_SSL_strings()
OPENSSL_INIT: ossl_init_async: async_init()
OPENSSL_INIT: ossl_init_load_crypto_strings:
err_load_crypto_strings_intern()
OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NULL,
alloc is 1 (6348)
OPENSSL_INIT: ossl_init_get_thread_local: Allocating a new local structure
(6348)
OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NOT NULL,
alloc is 1 (6348)
OPENSSL_INIT: ossl_init_thread_start: Starting (6348)
OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state (6348)
OPENSSL_INIT: ossl_init_thread_start: End (6348)
OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NULL,
alloc is 1 (5324)
OPENSSL_INIT: ossl_init_get_thread_local: Allocating a new local structure
(5324)
OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NOT NULL,
alloc is 1 (5324)
OPENSSL_INIT: ossl_init_thread_start: Starting (5324)
OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state (5324)
OPENSSL_INIT: ossl_init_thread_start: End (5324)
...
OPENSSL_INIT: OPENSSL_thread_stop: starting (6348)
OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NOT NULL,
alloc is 0 (6348)
OPENSSL_INIT: ossl_init_get_thread_local: Clearing Thread Locals (6348)
OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NOT NULL,
alloc is 0 (6348)
OPENSSL_INIT: ossl_init_thread_stop: starting (6348)
OPENSSL_INIT: ossl_init_thread_stop: ERR_remove_thread_state(NULL) (6348)
OPENSSL_INIT: OPENSSL_thread_stop: starting (5324)
OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NULL,
alloc is 0 (5324)
OPENSSL_INIT: ossl_init_get_thread_local: Clearing Thread Locals (5324)
OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NULL, alloc
is 0 (5324)
OPENSSL_INIT: ossl_init_thread_stop: starting (5324)
OPENSSL_INIT: ossl_init_thread_stop: locals are NULL returning (5324)
OPENSSL_INIT: OPENSSL_thread_stop: ending (5324)
OPENSSL_INIT: ossl_init_thread_stop: end (6348)
OPENSSL_INIT: OPENSSL_thread_stop: ending (6348)

Thread serveur 5324 termine
Thread client 6348 termine

OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NULL,
alloc is 0 (6240)
OPENSSL_INIT: ossl_init_get_thread_local: Clearing Thread Locals (6240)
OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NULL, alloc
is 0 (6240)
OPENSSL_INIT: ossl_init_thread_stop: starting (6240)
OPENSSL_INIT: ossl_init_thread_stop: locals are NULL returning (6240)
OPENSSL_INIT: ssl_library_stop: SSL_COMP_free_compression_methods()
OPENSSL_INIT: ssl_library_stop: ERR_free_strings()
OPENSSL_INIT: OPENSSL_cleanup: ERR_free_strings()
OPENSSL_INIT: OPENSSL_INIT_library_stop: CRYPTO_cleanup_all_ex_data()
OPENSSL_INIT: OPENSSL_INIT_library_stop: EVP_cleanup()
OPENSSL_INIT: OPENSSL_INIT_library_stop: CONF_modules_free()
OPENSSL_INIT: OPENSSL_INIT_library_stop: RAND_cleanup()
Assertion failed: !bLeak, file p:\mes
programmes\tests\_testsshared\teststls-11\testtls.cpp, line 165

Detected memory leaks!
Dumping objects ->
{7025} normal block at 0x00A75628, 8 bytes long.
 Data: <        > 00 00 00 00 01 00 00 00
{5009} normal block at 0x00A3CB88, 12 bytes long.
 Data: <         4  > A8 0C A4 00 00 00 00 00 C0 34 01 00
{5008} normal block at 0x00A40CA8, 400 bytes long.
 Data: <                > 00 00 00 00 C0 17 00 00 00 00 00 00 00 00 00 00
{5003} normal block at 0x00A3CCB8, 64 bytes long.
 Data: <                > 88 CB A3 00 00 00 00 00 00 00 00 00 00 00 00 00
{5001} normal block at 0x00A3C9B0, 96 bytes long.
 Data: <    P9P p9P     > B8 CC A3 00 50 39 50 00 70 39 50 00 08 00 00 00
Object dump complete.

WARNING: Visual Leak Detector detected memory leaks!
---------- Block 4993 at 0x00A3C9B0: 96 bytes ----------
  Leak Hash: 0x7CDBED0B, Count: 1, Total 96 bytes
  Call Stack (TID 4804):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (161): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (116): TestsTLS-11.exe!lh_new()
+ 0xE bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (321):
TestsTLS-11.exe!int_thread_get() + 0xF bytes
    e:\openssl-1.1.git\crypto\err\err.c (369):
TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (64):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 5001 at 0x00A3CB88: 12 bytes ----------
  Leak Hash: 0xE9B700C5, Count: 1, Total 12 bytes
  Call Stack (TID 6080):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (168):
TestsTLS-11.exe!lh_insert() + 0x11 bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_insert() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (371):
TestsTLS-11.exe!int_thread_set_item() + 0xD bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (222):
TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 4995 at 0x00A3CCB8: 64 bytes ----------
  Leak Hash: 0x8337F4DE, Count: 1, Total 64 bytes
  Call Stack (TID 4804):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (161): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\lhash\lhash.c (118): TestsTLS-11.exe!lh_new()
+ 0xE bytes
    e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
    e:\openssl-1.1.git\crypto\err\err.c (321):
TestsTLS-11.exe!int_thread_get() + 0xF bytes
    e:\openssl-1.1.git\crypto\err\err.c (369):
TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (884):
TestsTLS-11.exe!ERR_get_state() + 0xC bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (217):
TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (64):
TestsTLS-11.exe!CltThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 5000 at 0x00A40CA8: 400 bytes ----------
  Leak Hash: 0x2037555F, Count: 1, Total 400 bytes
  Call Stack (TID 6080):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (874):
TestsTLS-11.exe!ERR_get_state() + 0x14 bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (222):
TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


---------- Block 7017 at 0x00A75628: 8 bytes ----------
  Leak Hash: 0x82CA3A37, Count: 1, Total 8 bytes
  Call Stack (TID 6080):
    ntdll.dll!RtlAllocateHeap()
    f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
+ 0x15 bytes
    e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
0x9 bytes
    e:\openssl-1.1.git\crypto\mem.c (161): TestsTLS-11.exe!CRYPTO_zalloc() +
0x11 bytes
    e:\openssl-1.1.git\crypto\init.c (212):
TestsTLS-11.exe!ossl_init_get_thread_local() + 0x11 bytes
    e:\openssl-1.1.git\crypto\init.c (568):
TestsTLS-11.exe!ossl_init_thread_start() + 0x7 bytes
    e:\openssl-1.1.git\crypto\err\err.c (898):
TestsTLS-11.exe!ERR_get_state() + 0x9 bytes
    e:\openssl-1.1.git\crypto\err\err.c (598):
TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
    e:\openssl-1.1.git\ssl\statem\statem.c (279):
TestsTLS-11.exe!state_machine()
    e:\openssl-1.1.git\ssl\statem\statem.c (222):
TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
    e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
    p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
    p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
    p:\mes programmes\shared\sthread.cpp (17):
TestsTLS-11.exe!SThread::Run() + 0xE bytes
    f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
TestsTLS-11.exe!_threadstartex()


Visual Leak Detector detected 5 memory leaks (16416 bytes).
Largest number used: 442154 bytes.
Total allocations: 1908126 bytes.


--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Matt Caswell-2


On 18/02/16 11:37, Michel wrote:
> Hi Matt,
>
> Here under is the new results after applying your patch.
> Let me know anything I could do to investigate deeper.

Thanks. That was very helpful. I think I may have identified the issue.
Please can you try the attached patch and see if that fixes things?

Thanks

Matt



>
> Regards,
>
> Michel.
>
> Thread serveur 5324 demarre
> Thread client 6348 demarre
> OPENSSL_INIT: ossl_init_base: Setting up stop handlers
> OPENSSL_INIT: ossl_init_add_all_ciphers: openssl_add_all_ciphers_internal()
> OPENSSL_INIT: ossl_init_add_all_digests: openssl_add_all_digests_internal()
> OPENSSL_INIT: ossl_init_ssl_base: Adding SSL ciphers and digests
> OPENSSL_INIT: ossl_init_ssl_base: SSL_COMP_get_compression_methods()
> OPENSSL_INIT: ossl_init_ssl_base: SSL_add_ssl_module()
> OPENSSL_INIT: ossl_init_load_ssl_strings: ERR_load_SSL_strings()
> OPENSSL_INIT: ossl_init_async: async_init()
> OPENSSL_INIT: ossl_init_load_crypto_strings:
> err_load_crypto_strings_intern()
> OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NULL,
> alloc is 1 (6348)
> OPENSSL_INIT: ossl_init_get_thread_local: Allocating a new local structure
> (6348)
> OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NOT NULL,
> alloc is 1 (6348)
> OPENSSL_INIT: ossl_init_thread_start: Starting (6348)
> OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state (6348)
> OPENSSL_INIT: ossl_init_thread_start: End (6348)
> OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NULL,
> alloc is 1 (5324)
> OPENSSL_INIT: ossl_init_get_thread_local: Allocating a new local structure
> (5324)
> OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NOT NULL,
> alloc is 1 (5324)
> OPENSSL_INIT: ossl_init_thread_start: Starting (5324)
> OPENSSL_INIT: ossl_init_thread_start: marking thread for err_state (5324)
> OPENSSL_INIT: ossl_init_thread_start: End (5324)
> ...
> OPENSSL_INIT: OPENSSL_thread_stop: starting (6348)
> OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NOT NULL,
> alloc is 0 (6348)
> OPENSSL_INIT: ossl_init_get_thread_local: Clearing Thread Locals (6348)
> OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NOT NULL,
> alloc is 0 (6348)
> OPENSSL_INIT: ossl_init_thread_stop: starting (6348)
> OPENSSL_INIT: ossl_init_thread_stop: ERR_remove_thread_state(NULL) (6348)
> OPENSSL_INIT: OPENSSL_thread_stop: starting (5324)
> OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NULL,
> alloc is 0 (5324)
> OPENSSL_INIT: ossl_init_get_thread_local: Clearing Thread Locals (5324)
> OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NULL, alloc
> is 0 (5324)
> OPENSSL_INIT: ossl_init_thread_stop: starting (5324)
> OPENSSL_INIT: ossl_init_thread_stop: locals are NULL returning (5324)
> OPENSSL_INIT: OPENSSL_thread_stop: ending (5324)
> OPENSSL_INIT: ossl_init_thread_stop: end (6348)
> OPENSSL_INIT: OPENSSL_thread_stop: ending (6348)
>
> Thread serveur 5324 termine
> Thread client 6348 termine
>
> OPENSSL_INIT: ossl_init_get_thread_local: Starting: Local value is NULL,
> alloc is 0 (6240)
> OPENSSL_INIT: ossl_init_get_thread_local: Clearing Thread Locals (6240)
> OPENSSL_INIT: ossl_init_get_thread_local: Ending: Local value is NULL, alloc
> is 0 (6240)
> OPENSSL_INIT: ossl_init_thread_stop: starting (6240)
> OPENSSL_INIT: ossl_init_thread_stop: locals are NULL returning (6240)
> OPENSSL_INIT: ssl_library_stop: SSL_COMP_free_compression_methods()
> OPENSSL_INIT: ssl_library_stop: ERR_free_strings()
> OPENSSL_INIT: OPENSSL_cleanup: ERR_free_strings()
> OPENSSL_INIT: OPENSSL_INIT_library_stop: CRYPTO_cleanup_all_ex_data()
> OPENSSL_INIT: OPENSSL_INIT_library_stop: EVP_cleanup()
> OPENSSL_INIT: OPENSSL_INIT_library_stop: CONF_modules_free()
> OPENSSL_INIT: OPENSSL_INIT_library_stop: RAND_cleanup()
> Assertion failed: !bLeak, file p:\mes
> programmes\tests\_testsshared\teststls-11\testtls.cpp, line 165
>
> Detected memory leaks!
> Dumping objects ->
> {7025} normal block at 0x00A75628, 8 bytes long.
>  Data: <        > 00 00 00 00 01 00 00 00
> {5009} normal block at 0x00A3CB88, 12 bytes long.
>  Data: <         4  > A8 0C A4 00 00 00 00 00 C0 34 01 00
> {5008} normal block at 0x00A40CA8, 400 bytes long.
>  Data: <                > 00 00 00 00 C0 17 00 00 00 00 00 00 00 00 00 00
> {5003} normal block at 0x00A3CCB8, 64 bytes long.
>  Data: <                > 88 CB A3 00 00 00 00 00 00 00 00 00 00 00 00 00
> {5001} normal block at 0x00A3C9B0, 96 bytes long.
>  Data: <    P9P p9P     > B8 CC A3 00 50 39 50 00 70 39 50 00 08 00 00 00
> Object dump complete.
>
> WARNING: Visual Leak Detector detected memory leaks!
> ---------- Block 4993 at 0x00A3C9B0: 96 bytes ----------
>   Leak Hash: 0x7CDBED0B, Count: 1, Total 96 bytes
>   Call Stack (TID 4804):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (161): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (116): TestsTLS-11.exe!lh_new()
> + 0xE bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (321):
> TestsTLS-11.exe!int_thread_get() + 0xF bytes
>     e:\openssl-1.1.git\crypto\err\err.c (369):
> TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (64):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 5001 at 0x00A3CB88: 12 bytes ----------
>   Leak Hash: 0xE9B700C5, Count: 1, Total 12 bytes
>   Call Stack (TID 6080):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (168):
> TestsTLS-11.exe!lh_insert() + 0x11 bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_insert() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (371):
> TestsTLS-11.exe!int_thread_set_item() + 0xD bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (222):
> TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
> TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 4995 at 0x00A3CCB8: 64 bytes ----------
>   Leak Hash: 0x8337F4DE, Count: 1, Total 64 bytes
>   Call Stack (TID 4804):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (161): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\lhash\lhash.c (118): TestsTLS-11.exe!lh_new()
> + 0xE bytes
>     e:\openssl-1.1.git\crypto\err\err_lcl.h (2):
> TestsTLS-11.exe!lh_ERR_STATE_new() + 0x10 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (321):
> TestsTLS-11.exe!int_thread_get() + 0xF bytes
>     e:\openssl-1.1.git\crypto\err\err.c (369):
> TestsTLS-11.exe!int_thread_set_item() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (884):
> TestsTLS-11.exe!ERR_get_state() + 0xC bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (217):
> TestsTLS-11.exe!ossl_statem_connect() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\clttasks.cpp (64):
> TestsTLS-11.exe!CltThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 5000 at 0x00A40CA8: 400 bytes ----------
>   Leak Hash: 0x2037555F, Count: 1, Total 400 bytes
>   Call Stack (TID 6080):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (874):
> TestsTLS-11.exe!ERR_get_state() + 0x14 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (222):
> TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
> TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> ---------- Block 7017 at 0x00A75628: 8 bytes ----------
>   Leak Hash: 0x82CA3A37, Count: 1, Total 8 bytes
>   Call Stack (TID 6080):
>     ntdll.dll!RtlAllocateHeap()
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56): TestsTLS-11.exe!malloc()
> + 0x15 bytes
>     e:\openssl-1.1.git\crypto\mem.c (141): TestsTLS-11.exe!CRYPTO_malloc() +
> 0x9 bytes
>     e:\openssl-1.1.git\crypto\mem.c (161): TestsTLS-11.exe!CRYPTO_zalloc() +
> 0x11 bytes
>     e:\openssl-1.1.git\crypto\init.c (212):
> TestsTLS-11.exe!ossl_init_get_thread_local() + 0x11 bytes
>     e:\openssl-1.1.git\crypto\init.c (568):
> TestsTLS-11.exe!ossl_init_thread_start() + 0x7 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (898):
> TestsTLS-11.exe!ERR_get_state() + 0x9 bytes
>     e:\openssl-1.1.git\crypto\err\err.c (598):
> TestsTLS-11.exe!ERR_clear_error() + 0x5 bytes
>     e:\openssl-1.1.git\ssl\statem\statem.c (279):
> TestsTLS-11.exe!state_machine()
>     e:\openssl-1.1.git\ssl\statem\statem.c (222):
> TestsTLS-11.exe!ossl_statem_accept() + 0xB bytes
>     e:\openssl-1.1.git\ssl\ssl_lib.c (2905):
> TestsTLS-11.exe!SSL_do_handshake() + 0xC bytes
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (953):
> TestsTLS-11.exe!OTLS::TLSSss::DoHandshake() + 0xC bytes
>     p:\mes programmes\tests\_testsshared\teststls-11\srvtasks.cpp (79):
> TestsTLS-11.exe!SrvThread::Main() + 0xB bytes
>     p:\mes programmes\shared\sthread.cpp (17):
> TestsTLS-11.exe!SThread::Run() + 0xE bytes
>     f:\dd\vctools\crt\crtw32\startup\threadex.c (359):
> TestsTLS-11.exe!_threadstartex()
>
>
> Visual Leak Detector detected 5 memory leaks (16416 bytes).
> Largest number used: 442154 bytes.
> Total allocations: 1908126 bytes.
>
>

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

fix-win-thread-stop.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Michel
Yes !
With your 2 patches applied, tls_decrypt_ticket.patch and
fix-win-thread-stop.patch,
(looks like I lost the first one yesterday),
none of my tests programs using libSSL v1.1 reports leaks.

I feel better. :-)

Thank you Matt.

Regards,

Michel.

-----Message d'origine-----
De : openssl-dev [mailto:[hidden email]] De la part de Matt
Caswell
Envoyé : jeudi 18 février 2016 13:27
À : [hidden email]
Objet : Re: [openssl-dev] memory leaks detected using libSSL 1.1

On 18/02/16 11:37, Michel wrote:
> Hi Matt,
>
> Here under is the new results after applying your patch.
> Let me know anything I could do to investigate deeper.

Thanks. That was very helpful. I think I may have identified the issue.
Please can you try the attached patch and see if that fixes things?

Thanks

Matt


--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks detected using libSSL 1.1

Matt Caswell-2


On 18/02/16 13:59, Michel wrote:
> Yes !
> With your 2 patches applied, tls_decrypt_ticket.patch and
> fix-win-thread-stop.patch,
> (looks like I lost the first one yesterday),
> none of my tests programs using libSSL v1.1 reports leaks.
>
> I feel better. :-)

Great. I'll get those reviewed and committed.

Matt

--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev