getnamo / SocketIOClient-Unreal

Socket.IO client plugin for the Unreal Engine.
Other
899 stars 240 forks source link

Constant crashes when entering play mode #430

Open JetSimon opened 4 months ago

JetSimon commented 4 months ago

My Unreal editor crashes 1/3 of the time when entering play mode. I am using C++ but not native.

Abort signal received

ucrtbase
ucrtbase
ucrtbase
VCRUNTIME140_1
VCRUNTIME140_1
VCRUNTIME140_1
VCRUNTIME140_1
ntdll
ntdll
ntdll
KERNELBASE
VCRUNTIME140
UnrealEditor_SocketIOLib_0008!asio::detail::throw_exception<std::system_error>() [C:\Users\12508\GitRepos\ursula-sockets-repo\ShapeInworldTest\Plugins\SocketIOClient\Source\ThirdParty\asio\asio\include\asio\detail\throw_exception.hpp:42]
UnrealEditor_SocketIOLib_0008!asio::detail::do_throw_error() [C:\Users\12508\GitRepos\ursula-sockets-repo\ShapeInworldTest\Plugins\SocketIOClient\Source\ThirdParty\asio\asio\include\asio\detail\impl\throw_error.ipp:45]
UnrealEditor_SocketIOLib_0008!asio::detail::win_iocp_io_context::stop() [C:\Users\12508\GitRepos\ursula-sockets-repo\ShapeInworldTest\Plugins\SocketIOClient\Source\ThirdParty\asio\asio\include\asio\detail\impl\win_iocp_io_context.ipp:243]
UnrealEditor_SocketIOLib_0008!asio::io_context::run() [C:\Users\12508\GitRepos\ursula-sockets-repo\ShapeInworldTest\Plugins\SocketIOClient\Source\ThirdParty\asio\asio\include\asio\impl\io_context.ipp:61]
UnrealEditor_SocketIOLib_0008!sio::client_impl<websocketpp::client<websocketpp::config::asio_client> >::run_loop() [C:\Users\12508\GitRepos\ursula-sockets-repo\ShapeInworldTest\Plugins\SocketIOClient\Source\SocketIOLib\Private\internal\sio_client_impl.cpp:261]
UnrealEditor_SocketIOLib_0008!std::thread::_Invoke<std::tuple<std::_Binder<std::_Unforced,void (__cdecl sio::client_impl<websocketpp::client<websocketpp::config::asio_client> >::*)(void),sio::client_impl<websocketpp::client<websocketpp::config::asio_client> () [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\INCLUDE\thread:56]
ucrtbase
kernel32
ntdll
getnamo commented 4 months ago

Points to https://github.com/getnamo/SocketIOClient-Unreal/blob/master/Source/SocketIOLib/Private/internal/sio_client_impl.cpp#L261 which is when the thread stops and reset gets called. Check your alloc/dealloc logic and compare vs how it's done for the component life cycle.

getnamo commented 4 months ago

I'm seeing this error now, looks like a recent version broke it, use older plugin version for now until fix is found.

JetSimon commented 4 months ago

If it helps, I haven't had this issue occur since I stopped calling Disconnect and then Connect in the OnBegin (or whatever it is called) function of my socket actor c++ file. I think maybe a race condition there?