[openssl-dev] memory leaks detected using libSSL 1.1

Michel michel.sales at free.fr
Tue Feb 16 23:25:50 UTC 2016


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:openssl-dev-bounces at openssl.org] De la part de Matt
Caswell
Envoyé : mardi 16 février 2016 00:15
À : openssl-dev at openssl.org
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



More information about the openssl-dev mailing list