Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Unity Multiplayer Crash after sending a message with UNET Transport layer

Discussion in 'Connected Games' started by avivoren, Aug 13, 2018.

  1. avivoren

    avivoren

    Joined:
    Sep 21, 2014
    Posts:
    18
    I have an FPS game and the clients and the server sends a lot of messages but at any time at random the game can crash on the second message to the thousand message with this error:

    ========== OUTPUTTING STACK TRACE ==================

    0x00007FFC2A4C1EE7 (UnityPlayer) memcpy
    0x00007FFC29A18319 (UnityPlayer) UNET::VirtualUserHost::SendInt
    0x00007FFC29A17644 (UnityPlayer) UNET::NetLibraryManager::Send
    0x00007FFC29A23742 (UnityPlayer) NetworkTransport_CUSTOM_SendWrapper
    0x000002635949B5E1 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Networking.NetworkTransport:SendWrapper (int,int,int,byte[],int,byte&)
    0x000002635949B4D3 (Mono JIT Code) UnityEngine.Networking.NetworkTransport:Send (int,int,int,byte[],int,byte&)

    How can I fix it? Sometimes the game works just fine and sometimes it crashes randomly..
     
  2. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,490
    Could you please submit a bug-report, following the steps explained in this document:
    https://unity3d.com/unity/qa/bug-reporting

     
  3. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    It is possible only if you provide wrong length of your buffer for example byte[] b = new byte[10]; send( ...,b, 20); // crash... check this please
     
  4. avivoren

    avivoren

    Joined:
    Sep 21, 2014
    Posts:
    18
    It was the reason, I fixed it, thanks!
     
    aabramychev likes this.