beast
beast copied to clipboard
Crash in async_handshake function
This is the issue, which was already addressed in [email protected] list, that the function async_handshake crashes. I tried to prepare the smallest possible code, where the function still crashes. I'm using VS 2022 and the latest BOOST from github. Issue can be reproduced with 1.78.0 version as well. Also using latest OpenSSL from github, but it was reproduced with 3.0.1. Code is compiled in x64, /std:c++20. The sample code is located at: https://github.com/alesm2015/Boost-TLS-Server.git Only the location of BOOST and OpenSSL needs to be properly configured and code will compile. Also additional TLS client is required in order to reproduce crash. However the most interesting thing is, that the code works well if I simply remove two source files (binance_exchange.cpp and exchange.cpp) from compilation, despite those sources are never called, they are only compiled in this example. It looks, that something corrupts the heap memory. I double check mine sources and everything looks fine to me.
Thank you I'm on it.
I added simplied client to the same sources. Now the issue is simple to reproduce:
- Compile both sources
- Start server
- Start client As soon as client tries to connect to server, the server will crash.
I've compiled on linux and run. It doesn't do much but it doesn't crash. Now trying on Windows.
Thank you for your efforts. I didn't test the code on Linux, only on Visual Studio 2022. The code is intentionally as simple as possible, helping to focus to the issue only. I tested this code on two different computers and it crashed, on both each time. Using the same visual studio on both machines.
is that the release version of 2022 or a preview? try 2019, maybe there's a compiler bug. I never upgrade to the latest Visual Studio until it has been out for at least one year.
Tested with Visual Studio 2019 (version 16.11.10). I changed platform toolset back to v142. I also used OpenSSL v. 3.0.1 from https://kb.firedaemon.com/support/solutions/articles/4000121705, to avoid recompiling entire openssl sorces for VS 2019. The code still crash on the exactly the same location.
OK, I'll find it.
Not sure if this helps, but I think, the location where things starts rolling into wrong direction starts:
-
basic_stream.hpp in operator() in line: state().timer.async_wait(.......
-
async_base.hpp in get_executor() const noexcept
-
associated_executor.hpp in get_associated_executor(const T& t, const Executor& ex .... the value in ex looks corrupted
Is this resolved?