Leave server causes EXCEPTION_ACCESS_VIOLATION in FUniqueNetIdWrapper

Hi everybody!

I’m not shure, if this should be a bug report, or if I’m doing anything wrong. I’m trying to implement a custom OnlineSubsystem with a dedicated server. I can login, search for servers and join servers.

To leave the server and return to the main menu, I call the blueprint-node “Open Level”. According to the stacktrace, the NetConnection is been closed, while the Exception occurs and the game crashes:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000027

UE4Editor_Engine!FUniqueNetIdWrapper::ToDebugString() [D:\UnrealEngine\Engine\Source\Runtime\CoreUObject\Public\UObject\CoreOnline.h:236]
UE4Editor_Engine!UNetConnection::Describe() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\NetConnection.cpp:769]
UE4Editor_Engine!UNetConnection::Close() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\NetConnection.cpp:738]
UE4Editor_Engine!UNetDriver::Shutdown() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\NetworkDriver.cpp:1622]
UE4Editor_Engine!DestroyNamedNetDriver_Local() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:11456]
UE4Editor_Engine!UEngine::ShutdownWorldNetDriver() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:11176]
UE4Editor_Engine!UEngine::LoadMap() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:12487]
UE4Editor_Engine!UEngine::Browse() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:12101]
UE4Editor_Engine!UEngine::TickWorldTravel() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:12299]
UE4Editor_Engine!UGameEngine::Tick() [D:\UnrealEngine\Engine\Source\Runtime\Engine\Private\GameEngine.cpp:1675]
UE4Editor!FEngineLoop::Tick() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4850]
UE4Editor!GuardedMain() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Launch.cpp:169]
UE4Editor!GuardedMainWrapper() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137]
UE4Editor!WinMain() [D:\UnrealEngine\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268]
UE4Editor!__scrt_common_main_seh() [D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

Here i ran the game from Visual Studio to see more informations about the crash:

I suspected, I’m creating the UniqueNetId wrong. But logging in works and the server receives the correct username and can show the names of all players in the lobby. So it can’t be completely wrong :smiley:

I’m using Unreal Engine 4 from GitHub and the release-branch.

Does anyone has an idea, what could cause such a problem?

Did you solved it?

I think, When you leave a level, if the controller is destryed cause this problem.
Bud all the others pointers are nullptr too.
Then is a headche becouse in that moment IsValid() can fail too.

You can get an exception anywhere…
How did you handled it?

thx u!!