Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » SSL and USEMALLOC
SSL and USEMALLOC [message #58086] Fri, 11 February 2022 11:16 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1293
Registered: September 2007
Senior Contributor
Hi,

I have an application that needs to be compiled with USEMALLOC, but then SSL crashes on initblock :

SslInit
UPP_SSL_MALLOC(56, size 56, ../crypto/threads_pthread.c 29) -> 0x2b83088, MemorySize: 0, total = 64, thread: 139726390062464
UPP_SSL_MALLOC(176, size 176, ../crypto/lhash/lhash.c 51) -> 0x2b27578, MemorySize: 0, total = 248, thread: 139726390062464
UPP_SSL_MALLOC(128, size 128, ../crypto/lhash/lhash.c 59) -> 0x2b84f18, MemorySize: 0, total = 384, thread: 139726390062464
UPP_SSL_MALLOC(56, size 56, ../crypto/threads_pthread.c 29) -> 0x2b84d58, MemorySize: 0, total = 448, thread: 139726390062464
UPP_SSL_MALLOC(24, size 24, ../crypto/objects/o_names.c 219) -> 0x2b8e428, MemorySize: 0, total = 480, thread: 139726390062464
UPP_SSL_MALLOC(24, size 24, ../crypto/lhash/lhash.c 109) -> 0x2b8e548, MemorySize: 0, total = 512, thread: 139726390062464
UPP_SSL_MALLOC(24, size 24, ../crypto/objects/o_names.c 219) -> 0x2b8dbd8, MemorySize: 0, total = 544, thread: 139726390062464
UPP_SSL_FREE(0x2b8e428, size 32, ../crypto/objects/o_names.c 245), MemorySize: 0, total = 512, thread: 139726390062464
****************** PANIC: SslFree corrupted

UPP_SSL_FREE(0x2b83088, size 64, ../crypto/threads_pthread.c 111), MemorySize: 0, total = 448, thread: 139726390062464
UPP_SSL_FREE(0x2b8e548, size 32, ../crypto/lhash/lhash.c 144), MemorySize: 0, total = 416, thread: 139726390062464
UPP_SSL_FREE(0x2b8dbd8, size 32, ../crypto/objects/o_names.c 287), MemorySize: 0, total = 384, thread: 139726390062464
UPP_SSL_FREE(0x2b84f18, size 136, ../crypto/lhash/lhash.c 92), MemorySize: 0, total = 248, thread: 139726390062464
UPP_SSL_FREE(0x2b27578, size 184, ../crypto/lhash/lhash.c 93), MemorySize: 0, total = 64, thread: 139726390062464
UPP_SSL_FREE(0x2b84d58, size 64, ../crypto/threads_pthread.c 111), MemorySize: 0, total = 0, thread: 139726390062464



I'm not sure if it's an UPP problem, but with no USEMALLOC it doesn't crash there.
Re: SSL and USEMALLOC [message #58087 is a reply to message #58086] Sat, 12 February 2022 08:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13623
Registered: November 2005
Ultimate Member
Can you try this fix:

INITIALIZER(SSL)
{
	MemoryIgnoreLeaksBlock __;
	LLOG("SslInit");
	TcpSocketInit();
#ifdef UPP_HEAP
	CRYPTO_set_mem_functions(SslAlloc, SslRealloc, SslFree);
#endif
	SSL_library_init();
	SSL_load_error_strings();
}


?
Re: SSL and USEMALLOC [message #58094 is a reply to message #58087] Sat, 12 February 2022 22:35 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1293
Registered: September 2007
Senior Contributor
Yep, it works perfectly, thank you.
If you apply it, please add also the #ifdef to xxxalloc function bodies, otherwise you'll get an unused warning!
Previous Topic: HelloWorld example fails building
Next Topic: vectormap exampe is not working anymore
Goto Forum:
  


Current Time: Thu May 26 22:32:16 CEST 2022

Total time taken to generate the page: 0.01379 seconds