Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    16
    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:
    2,636
    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:
    545
    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:
    16
    It was the reason, I fixed it, thanks!
     
    aabramychev likes this.