getnamo / SocketIOClient-Unreal

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

Crash when exiting PIE mode #345

Open staskjs opened 2 years ago

staskjs commented 2 years ago

I use UE 5.0.3, plugin version 2.4. It happens occasionally, happened in 2.3 also. It always happens when I exit play mode and I only use functionality that plugin provides without this lower level stuff. I guess something doesn't close properly or interrupted somehow UPD: it sometimes happens in packaged game too. But sadly I can't notice any pattern...

LoginId:038116954dfe1cf063fd90bd33e0c640
EpicAccountId:058211863c844b839cba044a58fedc3d

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff

UnrealEditor_SocketIOLib!websocketpp::transport::asio::connection<websocketpp::config::asio_tls_client::transport_config>::handle_timer() [E:\Projects\sopsb\Plugins\SocketIOClient\Source\ThirdParty\websocketpp\websocketpp\transport\asio\connection.hpp:353]
UnrealEditor_SocketIOLib!sio::socket::impl::on_close() [E:\Projects\sopsb\Plugins\SocketIOClient\Source\SocketIOLib\Private\sio_socket.cpp:373]
UnrealEditor_SocketIOLib!asio::detail::wait_handler<std::_Binder<std::_Unforced,void (__cdecl sio::socket::impl::*)(void),sio::socket::impl *> >::do_complete() [E:\Projects\sopsb\Plugins\SocketIOClient\Source\ThirdParty\asio\asio\include\asio\detail\wait_handler.hpp:71]
UnrealEditor_SocketIOLib!asio::detail::win_iocp_io_context::do_one() [E:\Projects\sopsb\Plugins\SocketIOClient\Source\ThirdParty\asio\asio\include\asio\detail\impl\win_iocp_io_context.ipp:420]
UnrealEditor_SocketIOLib!asio::io_context::run() [E:\Projects\sopsb\Plugins\SocketIOClient\Source\ThirdParty\asio\asio\include\asio\impl\io_context.ipp:61]
UnrealEditor_SocketIOLib!sio::client_impl<websocketpp::client<websocketpp::config::asio_tls_client> >::run_loop() [E:\Projects\sopsb\Plugins\SocketIOClient\Source\SocketIOLib\Private\internal\sio_client_impl.cpp:261]
UnrealEditor_SocketIOLib!std::thread::_Invoke<std::tuple<std::_Binder<std::_Unforced,void (__cdecl sio::client_impl<websocketpp::client<websocketpp::config::asio_tls_client> >::*)(void),sio::client_impl<websocketpp::client<websocketpp::config::asio_tls_clien() [C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\INCLUDE\thread:56]
ucrtbase
kernel32
ntdll
getnamo commented 2 years ago

Platform? How are you using the plugin, through component or native method? https or http? Does changing Unbind Events on Disconnect stop this error for you?

It's also possible the disconnect thread is behaving differently for you (async disconnect is default, but I've never seen this error personally)

staskjs commented 2 years ago

It's on windows. I use components, instantiated at runtime in game instance. Https. I haven't checked Unbind Events on Disconnect, but I will try, thanks for the tip. I'll get back here if problem persists.

staskjs commented 2 years ago

Unbind Events on Disconnect doesn't seem to help. I think I figured out how to reproduce the issue. I put Join namespace in a umg widget on socket connected event. Then in widget's Destruct I was calling Leave namespace. Then Alt+F4 causes game to crash. But I didn't need to leave namespace after all, so it is fine for now...