You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use statically linked openssl to verify singature of client token inside of oatpp ENDPOINT handlers.
Oatpp simple mode creates a new thread for every connection.
Eventually, memory leak is caused by static linking, because in this case openssl doesn't call OPENSSL_thread_stop at thread exit.
But it would be great if oatpp provided some callback to free memory at stop of a detached thread.
https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_atexit.html
Resources local to a thread are deallocated automatically when the thread exits (e.g. in a pthreads environment, when pthread_exit() is called). On Windows platforms this is done in response to a DLL_THREAD_DETACH message being sent to the libcrypto32.dll entry point. Some windows functions may cause threads to exit without sending this message (for example ExitProcess()). If the application uses such functions, then the application must free up OpenSSL resources directly via a call to OPENSSL_thread_stop() on each thread. Similarly this message will also not be sent if OpenSSL is linked statically, and therefore applications using static linking should also call OPENSSL_thread_stop() on each thread. Additionally if OpenSSL is loaded dynamically via LoadLibrary() and the threads are not destroyed until after FreeLibrary() is called then each thread should call OPENSSL_thread_stop() prior to the FreeLibrary() call.
The text was updated successfully, but these errors were encountered:
I use statically linked openssl to verify singature of client token inside of oatpp ENDPOINT handlers.
Oatpp simple mode creates a new thread for every connection.
Eventually, memory leak is caused by static linking, because in this case openssl doesn't call OPENSSL_thread_stop at thread exit.
But it would be great if oatpp provided some callback to free memory at stop of a detached thread.
https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_atexit.html
Resources local to a thread are deallocated automatically when the thread exits (e.g. in a pthreads environment, when pthread_exit() is called). On Windows platforms this is done in response to a DLL_THREAD_DETACH message being sent to the libcrypto32.dll entry point. Some windows functions may cause threads to exit without sending this message (for example ExitProcess()). If the application uses such functions, then the application must free up OpenSSL resources directly via a call to OPENSSL_thread_stop() on each thread. Similarly this message will also not be sent if OpenSSL is linked statically, and therefore applications using static linking should also call OPENSSL_thread_stop() on each thread. Additionally if OpenSSL is loaded dynamically via LoadLibrary() and the threads are not destroyed until after FreeLibrary() is called then each thread should call OPENSSL_thread_stop() prior to the FreeLibrary() call.
The text was updated successfully, but these errors were encountered: