[openssl-dev] libcryto 1.1 leaks since old locks are removed

Matt Caswell matt at openssl.org
Thu Mar 17 09:37:07 UTC 2016


FYI, I have a fix for this but it is currently stalled in review due to
another related issue. Interim patch attached.

Matt


On 16/03/16 22:11, Michel wrote:
> Hi,
> 
>  
> 
> As in my previous post, libcrypto still leaks with OpenSSL version 1.1.0
> pre release 4.
> 
> Here is an example with the same test program that was running fine
> before I removed the old locking “stuff”.
> 
>  
> 
> Detected memory leaks!
> 
> Dumping objects ->
> 
> {1418} normal block at 0x0064EF98, 24 bytes long.
> 
> Data: <  d             > 98 1F 64 00 FF FF FF FF 00 00 00 00 00 00 00 00
> 
> {703} normal block at 0x00641E40, 24 bytes long.
> 
> Data: <x d             > 78 1E 64 00 FF FF FF FF 00 00 00 00 00 00 00 00
> 
> Object dump complete.
> 
> Debug Error!
> 
>  
> 
> ---------- Block 703 at 0x00641E40: 24 bytes ----------
> 
>   Leak Hash: 0x95EDDA21, Count: 1, Total 24 bytes
> 
>   Call Stack (TID 7140):
> 
>     ntdll.dll!RtlAllocateHeap()
> 
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56):
> TestsTLS-11.exe!malloc() + 0x15 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\mem.c (140):
> TestsTLS-11.exe!CRYPTO_malloc() + 0x9 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\mem.c (148):
> TestsTLS-11.exe!CRYPTO_zalloc() + 0x11 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\threads_win.c (57):
> TestsTLS-11.exe!CRYPTO_THREAD_lock_new() + 0xE bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\err\err.c (393):
> TestsTLS-11.exe!do_err_strings_init() + 0x5 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\threads_win.c (117):
> TestsTLS-11.exe!CRYPTO_THREAD_run_once()
> 
>     e:\openssl-1.1.0-pre4\crypto\err\err.c (711):
> TestsTLS-11.exe!ERR_func_error_string() + 0xF bytes
> 
>     e:\openssl-1.1.0-pre4\ssl\ssl_err.c (716):
> TestsTLS-11.exe!ERR_load_SSL_strings() + 0x14 bytes
> 
>     e:\openssl-1.1.0-pre4\ssl\ssl_init.c (180):
> TestsTLS-11.exe!ossl_init_load_ssl_strings()
> 
>     e:\openssl-1.1.0-pre4\crypto\threads_win.c (117):
> TestsTLS-11.exe!CRYPTO_THREAD_run_once()
> 
>     e:\openssl-1.1.0-pre4\ssl\ssl_init.c (258):
> TestsTLS-11.exe!OPENSSL_init_ssl() + 0x2B bytes
> 
>     e:\openssl-1.1.0-pre4\ssl\ssl_lib.c (2359):
> TestsTLS-11.exe!SSL_CTX_new() + 0xE bytes
> 
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (95):
> TestsTLS-11.exe!OTLS::TLSCtx::SetMinTLSVer() + 0x9 bytes
> 
>     p:\mes programmes\tests\_testsshared\teststls-11\testtls.cpp (63):
> TestsTLS-11.exe!main() + 0xC bytes
> 
>     f:\dd\vctools\crt\crtw32\startup\crt0.c (165):
> TestsTLS-11.exe!mainCRTStartup()
> 
>  
> 
> ---------- Block 1418 at 0x0064EF98: 24 bytes ----------
> 
>   Leak Hash: 0x9FBB4D3C, Count: 1, Total 24 bytes
> 
>   Call Stack (TID 7140):
> 
>     ntdll.dll!RtlAllocateHeap()
> 
>     f:\dd\vctools\crt\crtw32\misc\dbgmalloc.c (56):
> TestsTLS-11.exe!malloc() + 0x15 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\mem.c (140):
> TestsTLS-11.exe!CRYPTO_malloc() + 0x9 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\mem.c (148):
> TestsTLS-11.exe!CRYPTO_zalloc() + 0x11 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\threads_win.c (57):
> TestsTLS-11.exe!CRYPTO_THREAD_lock_new() + 0xE bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\ex_data.c (143):
> TestsTLS-11.exe!do_ex_data_init() + 0x5 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\threads_win.c (117):
> TestsTLS-11.exe!CRYPTO_THREAD_run_once()
> 
>     e:\openssl-1.1.0-pre4\crypto\ex_data.c (160):
> TestsTLS-11.exe!get_and_lock() + 0xF bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\ex_data.c (243):
> TestsTLS-11.exe!CRYPTO_get_ex_new_index() + 0x9 bytes
> 
>     e:\openssl-1.1.0-pre4\ssl\ssl_cert.c (146):
> TestsTLS-11.exe!ssl_x509_store_ctx_init() + 0x14 bytes
> 
>     e:\openssl-1.1.0-pre4\crypto\threads_win.c (117):
> TestsTLS-11.exe!CRYPTO_THREAD_run_once()
> 
>     e:\openssl-1.1.0-pre4\ssl\ssl_cert.c (152):
> TestsTLS-11.exe!SSL_get_ex_data_X509_STORE_CTX_idx() + 0xF bytes
> 
>     e:\openssl-1.1.0-pre4\ssl\ssl_lib.c (2367):
> TestsTLS-11.exe!SSL_CTX_new() + 0x5 bytes
> 
>     p:\mes programmes\shared\ocrypto-11\tls.cpp (95):
> TestsTLS-11.exe!OTLS::TLSCtx::SetMinTLSVer() + 0x9 bytes
> 
>     p:\mes programmes\tests\_testsshared\teststls-11\testtls.cpp (63):
> TestsTLS-11.exe!main() + 0xC bytes
> 
>     f:\dd\vctools\crt\crtw32\startup\crt0.c (165):
> TestsTLS-11.exe!mainCRTStartup()
> 
>  
> 
> Regards,
> 
>  
> 
> Michel
> 
>  
> 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lock-leaks-fix.patch
Type: text/x-patch
Size: 6930 bytes
Desc: not available
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20160317/ef80ce0e/attachment-0001.bin>


More information about the openssl-dev mailing list