Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. 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 at 2:10 AM.

  1. avivoren

    avivoren

    Joined:
    Sep 21, 2014
    Posts:
    12
    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,436
    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:
    542
    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:
    12
    It was the reason, I fixed it, thanks!
     
    aabramychev likes this.