New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

UE 4.17 and crash on server side

ginopelosoginopeloso Posts: 25
Brain Burst
edited September 8 in Unreal
I have a matchmaking pool and it worked well with UE 4.16. A side creates a session and another finds and joins it.
I'm still able to create and join a session, but, since the update to UE 4.17, the server side crashes after some seconds the client has joined the session. It crashes only when using the Oculus subsystem and a matchmaking session (works well when using the Null subsystem and a normal session).

It crashes with this error
[2017.09.08-10.24.01:995][ 94]LogWindows: Error: === Critical error: ===
[2017.09.08-10.24.01:995][ 94]LogWindows: Error: 
[2017.09.08-10.24.01:996][ 94]LogWindows: Error: Assertion failed: HasReceivedClientPacket() [File:D:\Build\++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\Engine\Private\NetConnection.cpp] [Line: 684]

So the problem is the method HasReceivedClientPacket() in the NetConnection class.
This method has been introduced in UE 4.17 (it does not exist in 4.16) and this is what it does:
FORCEINLINE bool HasReceivedClientPacket()
{
    return !!InternalAck || Driver->ServerConnection != nullptr || InReliable[0] != InitInReliable;
}

May you investigate on this problem?
Tagged:

Comments

  • bernhardschellingopubernhardschellingopu Posts: 7
    NerveGear
    edited September 12
    Here's an image of my response because this stupid garbage forum won't allow me to post with either images, attachments, both or neither because... I have no fucking idea... because my post is too long??? Wasted so much time trying to post this...



    Edit: Now after so much frustration this is what I am allowed to post?!?
    Prohibiting developers from writing useful bug reports is just another great Oculus idea I guess.
    Maybe I can also attach the 16 kb project ZIP file here... Let's try...

    Edit: Duh... this is just bonkers... You really need to fix your 'spam filter'... gah!
  • imperativityimperativity Posts: 1,604 Oculus Staff
    @ginopeloso

    Our internal teams are considering this a bug in UE 4.17 at this time due to:

    It is odd that the server side is crashing... That function is commented with "Whether or not a client packet has been received - used serverside, to delay any packet sends"

    However if this is used serverside it shouldn't be checking to see if the driver has a ServerConnection. That variable only exists if the net driver is a client.

    We are currently asking Epic for clarity on this issue.

  • bernhardschellingopubernhardschellingopu Posts: 7
    NerveGear
    I can confirm that since UE 4.17 the OculusNetDriver/OculusNetConnection part of the OnlineSubsystemOculus is broken. The matchmaking in FOnlineSessionOculus still works as mentioned but the P2P communication part broke due to the way networking changed in 4.17.

    In shipping builds where the assertion Checks() are not performed the server does not crash but a client is never able to connect. A connection is started but the client never even receives the UE4 welcome packet so it doesn't even load into the same map as the server. It just stays waiting forever (without any timeout ever) and the server seemingly so too. Nothing ever arrives in the game logic code side about a new connection as the engine seems to not be able to process anything from the connection at all (no controller, pawn or playerstate getting constructed or spawned even on the server).

    I'm attaching a very minimal example project I used to test this with two .uproject files for 4.16 and 4.17 in which the key [1] hosts a session and starts a server and the key [2] searches for a session and connects to it. After connection the host should spawn a new pawn for the client and on the client side the map should reload while receiving the replicated actors. To compile it make sure to set OculusAppId and OculusMyPoolName in DefaultEngine.ini. The matchmaking pool should be of type 'Browse' because the join code searches open sessions and joins the first session found.

    Here's how it looks on 4.16:

    And on 4.17:
    (in shipping builds the crash reporter does not appear but the screens show the same on both server and client)

    Here's the full stack trace for the assertion on the server:
    Assertion failed: HasReceivedClientPacket() [File:D:\Build\++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\Engine\Private\NetConnection.cpp] [Line: 684]

    UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:349]
    UE4Editor_Engine!UNetConnection::FlushNet() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:687]
    UE4Editor_Engine!UNetConnection::WriteBitsToSendBuffer() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:1299]
    UE4Editor_Engine!UNetConnection::SendAck() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:1428]
    UE4Editor_Engine!UNetConnection::ReceivedPacket() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:1270]
    UE4Editor_Engine!UNetConnection::ReceivedRawPacket() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:661]
    UE4Editor_OnlineSubsystemOculus_Win64_DebugGame!UOculusNetDriver::TickDispatch() [d:\unreal projects\oculusnettest\plugins\oculusplatformplugin\source\runtime\online\onlinesubsystemoculus\private\oculusnetdriver.cpp:188]
    UE4Editor_Engine!TBaseUObjectMethodDelegateInstance<0,UNetDriver,void __cdecl(float)>::ExecuteIfSafe() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:858]
    UE4Editor_Engine!TBaseMulticastDelegate<void,float>::Broadcast() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
    UE4Editor_Engine!UWorld::Tick() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1271]
    UE4Editor_Engine!UGameEngine::Tick() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\gameengine.cpp:1146]
    UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3215]
    UE4Editor!GuardedMain() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
    UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
    UE4Editor!WinMain() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
    UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
    kernel32
    ntdll

    Thanks for looking into this.

  • bernhardschellingopubernhardschellingopu Posts: 7
    NerveGear
    I can confirm that since UE 4.17 the OculusNetDriver/OculusNetConnection part of the OnlineSubsystemOculus is broken. The matchmaking in FOnlineSessionOculus still works as mentioned but the P2P communication part broke due to the way networking changed in 4.17.

    In shipping builds where the assertion Checks() are not performed the server does not crash but a client is never able to connect. A connection is started but the client never even receives the UE4 welcome packet so it doesn't even load into the same map as the server. It just stays waiting forever (without any timeout ever) and the server seemingly so too. Nothing ever arrives in the game logic code side about a new connection as the engine seems to not be able to process anything from the connection at all (no controller, pawn or playerstate getting constructed or spawned even on the server).

    I created a very minimal example project I used to test this with two .uproject files for 4.16 and 4.17 in which the key [1] hosts a session and starts a server and the key [2] searches for a session and connects to it. After connection the host should spawn a new pawn for the client and on the client side the map should reload while receiving the replicated actors. To compile it make sure to set OculusAppId and OculusMyPoolName in DefaultEngine.ini. The matchmaking pool should be of type 'Browse' because the join code searches open sessions and joins the first session found.

    Here's how it looks on 4.16: us.v-cdn.net/6024342/uploads/editor/4e/6hya9p9tc3ol.png

    And on 4.17: us.v-cdn.net/6024342/uploads/editor/vb/ega2zd0q7fy3.png
    (in shipping builds the crash reporter does not appear but the screens show the same on both server and client)


    Also here's the full stack trace for the assertion on the server:
    Assertion failed: HasReceivedClientPacket() [File:D:\Build\++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\Engine\Private\NetConnection.cpp] [Line: 684]

    UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:349]
    UE4Editor_Engine!UNetConnection::FlushNet() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:687]
    UE4Editor_Engine!UNetConnection::WriteBitsToSendBuffer() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:1299]
    UE4Editor_Engine!UNetConnection::SendAck() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:1428]
    UE4Editor_Engine!UNetConnection::ReceivedPacket() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:1270]
    UE4Editor_Engine!UNetConnection::ReceivedRawPacket() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:661]
    UE4Editor_OnlineSubsystemOculus!UOculusNetDriver::TickDispatch() [d:\build\++ue4+release-4.17+compile\sync\engine\plugins\online\onlinesubsystemoculus\source\private\oculusnetdriver.cpp:188]
    UE4Editor_Engine!TBaseUObjectMethodDelegateInstance<0,UNetDriver,void __cdecl(float)>::ExecuteIfSafe() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:858]
    UE4Editor_Engine!TBaseMulticastDelegate<void,float>::Broadcast() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
    UE4Editor_Engine!UWorld::Tick() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1271]
    UE4Editor_Engine!UGameEngine::Tick() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\engine\private\gameengine.cpp:1146]
    UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3215]
    UE4Editor!GuardedMain() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
    UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
    UE4Editor!WinMain() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
    UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
    kernel32
    ntdll

    Thanks for looking into this.

    PS: I really I wanted to attach the project (16kb ZIP file) and embed the two images into this post but the forum just says 'Your post will be seen once it is approved' for a few short seconds in the lower left corner and it keeps my post here as a draft. I missed the message at first and thought it was buggy so I just submitted it a few times. Now I learn about some invisible verification status which apparently even keeps developer from making useful bug reports... This really doesn't help the frustration with Oculus...
  • brian_jewbrian_jew Posts: 61 Oculus Staff
    Thanks for the sample project.  I'm able to repro the problem and am looking into how to fix this.
  • brian_jewbrian_jew Posts: 61 Oculus Staff
    edited September 21
    @bernhardschellingopu

    Update: found out what's causing the server side to crash and it has to do with the first bunch of packets sent by the client machine to be invalid.

    Working on both an actual fix and seeing if there's a workaround to help unblock you all in the meantime.
  • bernhardschellingopubernhardschellingopu Posts: 7
    NerveGear
    @brian_jew

    Thank you for investigating and for the good news!

    If the fix you are preparing is contained inside Engine/Plugins/Online/OnlineSubsystemOculus then I can just put it in our code base as we are using a customized OSS plugin anyway (to get avatar images, etc.). On the other hand if the fix touches the UE4 core engine code I guess we'd need to wait for EPIC to integrate that as we're not running custom engine builds.
    Cloning the plugin and placing it in the project directory is fairly easy so that could be a workaround for others as well.

    Thanks again,
    - Bernhard
  • imperativityimperativity Posts: 1,604 Oculus Staff
    @bernhardschellingopu

    I have word that a fix is in for this and should go out with our UE4.17.2 release on github.

  • brian_jewbrian_jew Posts: 61 Oculus Staff
    >If the fix you are preparing is contained inside Engine/Plugins/Online/OnlineSubsystemOculus

    Good news, it is contained to just that plugin folder.  You can pull it from our github: https://github.com/Oculus-VR/UnrealEngine/tree/4.17/Engine/Plugins/Online/OnlineSubsystemOculus
  • bernhardschellingopubernhardschellingopu Posts: 7
    NerveGear
    brian_jew said:
    Good news, it is contained to just that plugin folder.  You can pull it from our github: https://github.com/Oculus-VR/UnrealEngine/tree/4.17/Engine/Plugins/Online/OnlineSubsystemOculus

    Good stuff! I merged the changes in OculusNetDriver.h, OculusNetDriver.cpp and OculusNetConnection.cpp into our customized plugin and preliminary tests show networking as working fine again (connection established, joined, actors replicated, etc.).

    For anyone interested into incorporating this fix into their own C++ project, you can move the engine plugin into your project.
    1. Create a directory named 'Plugins' in your project directory
    2. Create a directory 'OnlineSubsystemOculusCustom' inside 'Plugins'.
    3. Copy all of https://github.com/Oculus-VR/UnrealEngine/tree/4.17/Engine/Plugins/Online/OnlineSubsystemOculus into it.
    4. Rename 'OnlineSubsystemOculus.uplugin' to 'OnlineSubsystemOculusCustom.uplugin'.
    5. Modify your .uproject file and change the 'Enabled' state of 'OnlineSubsystemOculus' to false and add an entry for your local 'OnlineSubsystemOculusCustom'. Example:
            { "Name": "OnlineSubsystemOculus", "Enabled": false },
            { "Name": "OnlineSubsystemOculusCustom", "Enabled": true },

    Thanks again for the fix!
    - Bernhard
Sign In or Register to comment.