Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Resolved Caught fatal signal - signo:11 code:1 errno:0 addr:0x20

Discussion in 'Unity Transport' started by gkunity123, Jul 27, 2023.

  1. gkunity123

    gkunity123

    Joined:
    Jul 24, 2023
    Posts:
    6
    I am developing a game with netcode for gameobjects and i am using Unity Transport. After making the game encrypted (wss), the server crashes when the client exits the game.

    Unity editor version: 2022.3.5f1
    Netcode for GameObjects version: 1.5.1
    Unity Transport version: 2.0.2

     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    What platform is this on? Also, are you using Unity Relay or direct IP connections?
     
  3. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Also, how is the client exiting the game? Is it a clean disconnect (calling the
    NetworkManager.Shutdown
    method)? Is the client just closing the application? What platform is the client on?
     
  4. gkunity123

    gkunity123

    Joined:
    Jul 24, 2023
    Posts:
    6
    Server Platform: Linux
    Client Platform: WebGL
    Connection Type: Direct IP Connection(with wss://domain:port with A Record)
    I get the error when the user just closes the application directly.
     
  5. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    If you're able to make a server build with Burst disabled (you can do that in the Burst AOT settings), that might produce a more interesting stack trace. I'm thinking the one in your original message might be bad in some way since that
    unitytls_client_get_ciphersuite_cnt
    function isn't being called by the TLS send job.
     
  6. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Looking at the code on my end, I can see a scenario where a segfault would occur in the TLS layer if the connection was suddenly closed while there were packets pending to be sent.

    I'll make the fix in the transport package and try to get a release going, but in the meantime if you're willing to use a customized version of the transport package (here are instructions to do so), you could patch it yourself. You'd need to add the following code at line 519-ish of
    Runtime/Layers/TLSLayer.cs
    :
    Code (CSharp):
    1. var clientPtr = ConnectionsData[connectionId].UnityTLSClientPtr;
    2. // Add these lines:
    3. var connectionState = Connections.GetConnectionState(connectionId);
    4. if (clientPtr == null || connectionState != NetworkConnection.State.Connected)
    5. {
    6.     packetProcessor.Drop();
    7.     continue;
    8. }
     
    zhare86 likes this.
  7. gkunity123

    gkunity123

    Joined:
    Jul 24, 2023
    Posts:
    6
    Thank you for the help.
     
  8. gkunity123

    gkunity123

    Joined:
    Jul 24, 2023
    Posts:
    6
     

    Attached Files:

  9. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Ah yes my apologies. I had forgotten that the connection list wasn't passed to the send job in the TLS layer. You can remedy this by adding this line at the top of the
    SendJob
    structure (line 495-ish):
    Code (CSharp):
    1. public ConnectionList Connections;
    And then this line in the creation of the
    SendJob
    instance (line 565-ish):
    Code (CSharp):
    1. Connections = m_ConnectionList,
     
  10. zhare86

    zhare86

    Joined:
    Mar 28, 2017
    Posts:
    30
    Thanks, I've run into this as well and fixed it for the time being with the code snippet above.
     
  11. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    The fix should also be available in the last version of the transport package (2.1.0) should you wish to upgrade.
     
  12. dan_ginovker

    dan_ginovker

    Joined:
    Jun 13, 2021
    Posts:
    76
  13. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Are you seeing the issue with 1.4.0? The error reported here was for code that only exists in 2.X. I would not expect this error to occur in the 1.X version of UTP. If it does, we'd need a detailed stack trace to investigate what's happening.