Search Unity

Bug The dedicated server crashed

Discussion in 'Physics' started by L0tussss5, Jun 6, 2023.

  1. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    Hello, I used Unity as my game server, but now I'm encountering a problem and it crashes several times a day.
    And there are only dmp and no other logs in the directory, so I opened an editor to display the logs,This problem has been bothering me for a while.
    It seems to be related to physical simulation. I opened 40 physical scenes for the player's room
     

    Attached Files:

  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    What version of Unity is this? Can you upload the full player log?
     
  3. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    hello,unity is 2021.3.14f1c1.What other logs do you need and in which folder do I need to view them?
     
  4. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    There is only one dmp file, and the other log is from the editor which connect the server upload_2023-6-7_1-12-24.png
     
  5. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    log is in rar,i was uploaded
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Can you build the player with "Copy PDB Files" option and send me UnityPlayer.dll & the PDB file that gets copied next to it?
     
  7. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    sure,How can I send it to you
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Thanks, I received it. It seems it crashes somewhere where you call Physics.Simulate() from your script. I cannot tell which script is calling it, unfortunately. Something seems to go wrong with detecting trigger enter/exits.

    Also, it seems you are using the China version of Unity. While they are similar in practice, they do have their differences and I do not have access to view its code. The support for them is handled by Unity China over at https://developer.unity.cn/.
     
  9. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    Thank you, as there is no dedicated technical support for Chinese forums, I have asked before but have not received a response.
    May I ask how you know the problem occurred in the trigger enter, can I locate which script in some way, and why the logic in the trigger enter can cause crashes? Can I use try catch to avoid crashes, or what other way to avoid crashes?
    I really want to locate the script and avoid crashes now
     
  10. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    Is there an infinite loop in the trigger enter or an array out of bounds in the trigger enter? Can I use try catch to avoid crashes? Shouldn't it usually be an error? Why is it a direct crash
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I opened the .dmp file you sent me in Visual Studio and pointed it at the PDB file you sent me. I found this callstack:

    upload_2023-6-6_14-3-16.png

    It seems it's accessing invalid memory for one of the trigger enter/exit colliders. Try/catch will not work, it's an internal engine crash in native code.

    Do you have many trigger colliders in your scene? Perhaps it's worth trying to delete them 1 by 1 until you find the culprit? How many places do you have Physics.Simulate() from?
     
  12. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    I have over 40 physic scenes, and each scene will be simulated by myself.
    There are triggers in each scene, which are used to switch scene.
    I did a crash when entering the trigger used for switching scene before, but the probability was particularly low, and my intuition was also that the trigger used for this switching scenario caused the crash
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I suggest reporting a bug on this using the in-editor bug reporter. I will move this post to the Physics forum in case somebody there has some better tips. I don't know enough about that system.
     
  14. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    Okay, thank you You're a good person
     
  15. L0tussss5

    L0tussss5

    Joined:
    Jun 22, 2022
    Posts:
    14
    Hello everyone, can you help me