Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Crash after sending a message with UNET Transport layer

Discussion in 'UNet' started by avivoren, Aug 13, 2018.

  1. avivoren

    avivoren

    Joined:
    Sep 21, 2014
    Posts:
    42
    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

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    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:
    42
    It was the reason, I fixed it, thanks!
     
    aabramychev likes this.