New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak on openssl 1.1.1 + libcurl static library #5282
Comments
I find it very unlikely to be a curl bug. We run all tests with leak detection tools in the CI all the time. How do you detect that there's a leak? Where is it saying that the leak happens? If you can make it not leak by changing how you link with openssl then it seems to indicate something weird since then obviously it is the exact same (curl) code being executed |
Hi bagder, Just now, I try download the openssl static library from online and rebuild it with curl, and then the memory leak is gone. I think the memory leak problem is due to my openssl self-build even the nmake test is pass and the openssl is work but it occurs memory leak. I will keep finding the root cause on openssl build problem. Thanks for your reply. |
Hi bagder, I found the root cause is I need manually call OPENSSL_thread_stop() on the thread function end. Thanks for your help 😊 Ref: OPENSSL_thread_stop
|
I did this
Hi, I occur a memory leak problem on openssl 1.1.1 + libcurl, I did this:
build openssl 1.1.1 static library, build steps:
$ perl Configure VC-WIN32 --prefix="C:\openssl\2017\win32\libmt" no-asm -DOPENSSL_USE_IPV6=1 no-shared
$ nmake
$ nmake test
$ nmake install
build libcurl:
$ open VS2017 x86 Native Tools Command Prompt
$ cd curl/winbuild
$ open MakefileBuild.vc, append "/NXCOMPAT /DYNAMICBASE" to LFLAGS
$ nmake /f Makefile.vc mode=static RTLIBCFG=static VC=14.1 WITH_DEVEL="C:\openssl\2017\win32\libmt" WITH_SSL=static ENABLE_IPV6=yes ENABLE_SSPI=no ENABLE_IDN=no ENABLE_WINSSL=no DEBUG=no GEN_PDB=yes MACHINE=x86
import openssl & libcurl into my example code:
example-code
vld-output.txt
run the above sample code, the memory leak occurs.
The memory leak occurs conditions:
I expected the following
No memory leak on openssl 1.1.1 + libcurl statlic library
curl/libcurl version
operating system
The text was updated successfully, but these errors were encountered: