-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Httpclient calls with OpenSSL 1.0.1e crash #188
Comments
@y1015860449, thanks for the report. Could you please give me more information about it to reproduce the problem on my machine for debugging? |
Might want to have a catch somewhere in SSLClient or SSLServer to print the SSL error stack with |
@yhirose There are four crashes in two days. Use the thread pool to continuously send post requests. |
@y1015860449, sorry but I don't understand what you mean by 'the thread pool'. Could you explain clearly what you are actually doing by showing the small code snippet of your code? Also what OS and compiler are you using? Thanks! |
Crash core:
code:
|
@y1015860449, thanks for the code snippet. It helps me a lot. I have some additional simple questions for you, so that I could reproduce it on my machine:
I especially want to know the answer to the question 2. Thanks. |
@yhirose 1、yes。 |
@y1015860449, thanks for the answers. I now have to work seriously on the thread issue which happens with versions prior to 1.1.0. Lines 2361 to 2365 in 3d1ae3a
|
@y1015860449, I made a necessary thread safety change for versions prior to 1.1.0 according to the OpenSSL documentation. Could you try with the latest httplib.h? |
@yhirose I will test it today. Does OPENSSL_VERSION_NUMBER require conditional compilation? How to compile with CMakeList if needed? |
@y1015860449, as you can see my changes below, I have already added the Lines 2484 to 2523 in 7267b3f
|
@yhirose Compile Error.
|
Were you using #include inside files which were then themselves included? Or is cmake cache still using the old version of cpp-httplib? |
@PixlRainbow The intermediate file generated by cmake has been cleaned up and recompiled. The result is still incorrect. |
@y1015860449 and @PixlRainbow, thanks for the investigation. I reproduced the linker errors with multiple translation units all of which include httplib.h. Could you try with the latest? By the way, according to the official OpenSSL site, the version 1.0.1e is no longer supported and has security risks. https://www.openssl.org/policies/releasestrat.html |
@yhirose Thank you for your answer, I am now verifying that there is still a crash. |
@y1015860449, thanks for your further investigation. Is it possible for you to test with the latest version 1.1.1 on your project to see if the same crash happens? Thanks! |
@yhirose thanks for your answer. After the crash did not appear (openssl 1.01e), we have already tested it, but we have been testing it for a long time, the memory is constantly increasing, it feels like there is a memory leak. I looked up the code of my own, there is no memory that is not released, so please look at the libhttp library for memory leaks, I am currently using multiple threads to call httpclient. |
@yhirose I will find a time to test the latest openssl library later. |
@y1015860449, is it possible for you to test with |
@y1015860449, I'll close it because the crash problem seems to be gone. If you verify the memory leak problem, could you submit another issue? Thanks for your help! |
@yhirose OpenSSL 1.1.1l 24 Aug 2021 This version's client still crash on latest fedora platform for multi thread.
|
If you have time, pls help to resolve it. |
Thanks you. |
OS: Fedora, docker env Multi thread library use boost::asio::thread_pool, `AsyncConCurrResult async_concurr_decorator_run(void (*f)(const std::string&, json&), const std::string& path) {
|
The decorator func just use cpp-httplib as belows, `bool HttpUtil::get_str(std::string host, std::string path, const std::map<std::string, std::string> & headers, std::string &result_string) {
}` |
According to #1097, it's not a bug in httplib.h. |
Crash core:
The text was updated successfully, but these errors were encountered: