Projects crash when launched with 2 players

I decided to begin working with networking features, however, all projects created in 4.7 crash with call stack that is provided below. I was able to reproduce it in blank bp, blank c++, first person c++ and third person c++ templates (didn’t check others as call stack in all cases was exactly same). I changed nothing, all of them crash as soon as are launched with 2 players. All of them work fine in singleplayer mode though. I downloaded engine via launcher.

I successfully launched shooter game example and third person c++ template I had created back in 4.4 with 2 players, so there shouldn’t be any problems with my computer, antivirus or blocked ports.

I searched web but didn’t find a solution, did someone experience similar problems? I found a suggestion to add NetDriverDefinitions to defaultengine.ini, but it didn’t help. I also noticed that all header files are located in Source/Public and all cpp files are located in Source/Private in projects that work in multiplayer, while both headers and source sode files are located in Source folder in projects that crash. I moved all headers into Source/Public and cpp files into /Private, but it didn’t fix issue. I suspect that either there are problems with IpNetDriver configuration or some engine parameters are not configured properly in these projects. However, I am wary of changing engine configuration by hand as I don’t yet completely understand its inner workings.

Your help will be very much appreciated.


VS Output:

[2015.03.31-12.21.14:545][250]LogPlayLevel: PIE: No blueprints needed recompiling

[2015.03.31-12.21.14:547][250]PIE: New page: PIE session: ThirdPersonExampleMap (Apr 1, 2015, 12:21:14 AM)

[2015.03.31-12.21.14:579][250]LogPlayLevel: PIE: StaticDuplicateObject took: (0.030403s)

[2015.03.31-12.21.14:582][250]LogPlayLevel: PIE: World Init took: (0.001624s)

[2015.03.31-12.21.14:582][250]LogPlayLevel: PIE: Created PIE world by copying editor world from
/Game/ThirdPerson/Maps/ThirdPersonExampleMap.ThirdPersonExampleMap to /Game/ThirdPerson/Maps/UEDPIE_1_ThirdPersonExampleMap.ThirdPersonExampleMap (0.034109s)

thread 0x116c has exited with code 0 (0x0).

thread 0x1670 has exited with code 0 (0x0).

[2015.03.31-12.21.14:624][250]LogWorld: Game class is ‘ThirdPersonCPP47GameMode’

[2015.03.31-12.21.14:627][250]LogAIModule: Creating AISystem for world ThirdPersonExampleMap

[2015.03.31-12.21.14:635][250]LogWorld: Bringing World
/Game/ThirdPerson/Maps/UEDPIE_1_ThirdPersonExampleMap.ThirdPersonExampleMap up for play (max tick rate 0) at 2015.03.31-18.21.14

[2015.03.31-12.21.14:636][250]LogWorld: Bringing up level for play took: 0.008401

[2015.03.31-12.21.14:638][250]LogInit: WinSock: Socket queue 131072 / 131072

[2015.03.31-12.21.16:905][250]LogSockets:Warning: Unhandled getaddrinfo() socket error! Code: 11004

UE4Editor.exe has triggered a breakpoint.


UE Report:

Unknown exception - code 00000001 (first/second chance not available)

Assertion failed: 0 [File:d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\sockets\private\bsdsockets\SocketSubsystemBSDPrivate.h] [Line: 94]

KERNELBASE + 42141 bytes

UE4Editor_Core!FOutputDeviceWindowsError::Serialize() + 292 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:95]

UE4Editor_Core!FOutputDevice::Logf__VA() + 248 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\misc\outputdevice.cpp:144]

UE4Editor_Core!FDebug::AssertFailed() + 1079 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\misc\outputdevice.cpp:224]

UE4Editor_Sockets!FSocketSubsystemBSDCommon::TranslateGAIErrorCode() + 248 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\sockets\private\bsdsockets\socketsubsystembsdprivate.h:99]

UE4Editor_Sockets!FSocketSubsystemBSD::GetHostByName() + 208 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\sockets\private\bsdsockets\socketsubsystembsd.cpp:69]

UE4Editor_Sockets!ISocketSubsystem::GetLocalHostAddr() + 975 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\sockets\private\socketsubsystem.cpp:310]

UE4Editor_Sockets!ISocketSubsystem::GetLocalBindAddr() + 44 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\sockets\private\socketsubsystem.cpp:253]

UE4Editor_OnlineSubsystemUtils!UIpNetDriver::InitBase() + 720 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\online\onlinesubsystemutils\private\ipnetdriver.cpp:109]

UE4Editor_OnlineSubsystemUtils!UIpNetDriver::InitListen() + 64 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\online\onlinesubsystemutils\private\ipnetdriver.cpp:152]

UE4Editor_Engine!UWorld::Listen() + 384 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:3927]

UE4Editor_Engine!UGameInstance::StartPIEGameInstance() + 1537 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\gameinstance.cpp:218]

UE4Editor_UnrealEd!UEditorEngine::CreatePIEGameInstance() + 8708 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:2861]

UE4Editor_UnrealEd!UEditorEngine::SpawnIntraProcessPIEWorlds() + 587 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:2274]

UE4Editor_UnrealEd!UEditorEngine::PlayInEditor() + 7122 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:2227]

UE4Editor_UnrealEd!UEditorEngine::StartQueuedPlayMapRequest() + 643 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:974]

UE4Editor_UnrealEd!UEditorEngine::Tick() + 3604 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:1226]

UE4Editor_UnrealEd!UUnrealEdEngine::Tick() + 22 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedengine.cpp:347]

UE4Editor!FEngineLoop::Tick() + 4179 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2257]

UE4Editor!GuardedMain() + 1404 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142]

UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]

UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]

UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Hi MstislavBor,

I haven’t been able to reproduce a crash in 4.7.3 when using 2 players. Does editor crash, or are you packaging game and game crashes? Are you using PIE or Launch? Can you walk me through exact steps you took to get this crash? Thanks!

editor crashes when I press Play with number of players set to 2. I’m using Play in Editor (Selected Viewport). I also tried running with Dedicated Server option on, and editor crashed with any number of players.

I checked projects created in earlier engine versions (from 4.4 to 4.6) and everything works fine, I am able to run them with several players and with dedicated server, everything replicates correctly. I switched engine version in launcher and created new projects in 4.4 and 4.6, all of them work fine as well. I verified my 4.7 install, but it didn’t fix issue in that version.

In order to reproduce this crash, I just created a new project, set number of players to 2 and clicked Play.

I have digged into issue and examined cause of crash in more detail. It seems that crash happens when ‘getaddrinfo’ function is called. It takes ANSICHAR* parameter, which, if I understand everything correctly, is an array, each element of which contains only 8 bits and supports only latin characters. I have non-latin characters in hostname of my computer, which is probably why editor crashes for me but not for you. I found in Microsoft documentation that there is also GetAddrInfoW function, which is its Unicode equivalent. I suppose that if it is used instead of ansi getaddrinfo, everything will work correctly. I have not been able to verify my guess yet, but it seems to be reasonable.

If there is anything I can do to help solve issue, please let me know.

Hey MstislavBor,

It looks like you’re getting an error when calling GetHostByName that TranslateGAIErrorCode isn’t handling and check is failing because of that. We have a bug report for that in our system already (UE-9103), and we’re working on a fix that we hope will be in 4.8.

For now, you can try adding " multihome=127.0.0.1" to your commandline (create a shortcut to Editor and add that to its Target). Otherwise, multihome needs to be IP address of server you’re connecting to. You might still have networking issues, but at least that should stop crash.

temporary solution you suggested (multihome) worked. All projects launched with two players and dedicated server successfully, and replication worked correctly in third person template (I didn’t check it in others yet). Thank you very much for your time and advice!