getnamo / SocketIOClient-Unreal

Socket.IO client plugin for the Unreal Engine.
Other
876 stars 236 forks source link

Engine Crash !! using UE 4.27 AND UE 5 Plugin version 2.1.1 and 1.10 #306

Open Hesham74 opened 2 years ago

Hesham74 commented 2 years ago

when I'm testing the new version of the plugin with UE5 AND UE4.27 with the socket IO CLient example project and I hosted the socket io server code at Heroku for testing .. https://tsslsocketiotest.herokuapp.com/ The engine crashes in these cases: 1- trying to connect to my hosted server using HTTP:// is not connecting and crashes after trying to reconnect 2- and if I try to connect to an invalid server ( HTTP:// or HTTPS://) it crashes too

the issues are: 1- trying to connect to an HTTP server not connected I tested it with an old version of the plugin and it works fine 2- crashes when we have connection problems because of the onconnectionproblems delegate

i found the problem at the socketiocommponnent class at OnConnectionProblems.Broadcast(AttemptCount, DelayInMs, ElapsedInSec);

and when I commented //OnConnectionProblems.Broadcast(AttemptCount, DelayInMs, ElapsedInSec); on it the engine didn't crash again I don't know what is the problem with this delegate

the sorce file is :\Plugins\SocketIOClient\Source\SocketIOClient\Private\SocketIOClientComponent.cpp

void USocketIOClientComponent::SetupCallbacks() { .... ... UE_LOG(LogTemp,Warning,TEXT("!! ConnectionProblem ")) //OnConnectionProblems.Broadcast(AttemptCount, DelayInMs, ElapsedInSec); .. .. } At the end, I hope to say thanks for your great job on making this plugin support HTTPS :)

getnamo commented 2 years ago

Really useful debug information, do you have a log file of the crash (usually found in saved)?

Hesham74 commented 2 years ago

yea sorry I forget to add the logs 👍

this logs when I'm debugging at the Visual studio:

2022.04.10-15.12.08:158][168]LogGameState: Match State Changed from WaitingToStart to InProgress [2022.04.10-15.12.08:171][168]LogLoad: Took 0.607599 seconds to LoadMap(/Game/Map/Map03) [2022.04.10-15.12.45:479][615]SocketIO: SocketIO Invalid appears to have lost connection, reconnecting attempt 0 with delay 3000 [2022.04.10-15.12.45:489][615]LogAudioMixer: Resetting audio stream to device id The thread 0x3330 has exited with code 0 (0x0). [2022.04.10-15.12.45:503][615]LogAudioMixer: Display: 0: FrontLeft [2022.04.10-15.12.45:503][615]LogAudioMixer: Display: 1: FrontRight [2022.04.10-15.12.45:549][615]LogAudioMixer: Resetting audio stream to device id The thread 0x50b4 has exited with code 0 (0x0). [2022.04.10-15.12.45:559][615]LogAudioMixer: Display: 0: FrontLeft [2022.04.10-15.12.45:559][615]LogAudioMixer: Display: 1: FrontRight **[2022.04.10-15.12.49:483][971]SocketIO: SocketIO Invalid appears to have lost connection, reconnecting attempt 1 with delay 4500 [2022.04.10-15.12.49:504][971]LogBlueprintUserMessages: [SocketIOActor_1] CLOSE REASON NORMAL

Exception thrown: read access violation. 🐛 this was 0xFFFFFFFFFFFFFFF7.

The thread 0xa5c has exited with code 0 (0x0). Unhandled exception thrown: read access violation. this was 0xFFFFFFFFFFFFFFF7.**

and I think these Logs will be useful 👍
it seems that the delegate is calling a null ptr variable or something

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff

UE4Editor_SocketIOClient!TMulticastScriptDelegate::ProcessMulticastDelegate() [D:\EpicGames\UE_4.27\Engine\Source\Runtime\Core\Public\UObject\ScriptDelegates.h:481]

UE4Editor_SocketIOClient!::operator()() [...\Plugins\SocketIOClient\Source\SocketIOClient\Private\SocketIOClientComponent.cpp:194]

UE4Editor_SocketIOClient!UE4Function_Private::TFunctionRefCaller<,void __cdecl(void)>::Call() [D:\Epic Games\UE_4.27\Engine\Source\Runtime\Core\Public\Templates\Function.h:549]

UE4Editor_CoreUtility!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(void),0> >::ExecuteTask() [D:\Epic Games\UE_4.27\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:886]

UE4Editor_Core UE4Editor_Core UE4Editor_Core UE4Editor_Engine UE4Editor_Engine UE4Editor_Engine UE4Editor_Engine UE4Editor_UnrealEd UE4Editor_UnrealEd UE4Editor UE4Editor UE4Editor UE4Editor UE4Editor UE4Editor kernel32 ntdll

getnamo commented 2 years ago

Test https://github.com/getnamo/SocketIOClient-Unreal/releases/tag/v2.3.0 and see if same behavior remains