Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Why did my Unity Linux server crash without a stack trace?

Discussion in 'Linux' started by Ann_17, May 26, 2023.

  1. Ann_17

    Ann_17

    Joined:
    Apr 9, 2021
    Posts:
    3
    I'm glad to be able to discuss Unity-related content with everyone on the forum. As a beginner to Unity, I have a lot of knowledge that I don't understand, so I hope everyone can teach me.

    My project uses C# as the development language and uses Unity's Headless Mode (i.e. Linux Build) as the game server. In certain scenarios, my Linux server will crash, and Unity will produce corresponding crash logs. What puzzles me is that the log of the crash only has a prediction similar to
    "Caught fatal signal - signo:11 code:1 errno:0 addr:0x7f4f62da8138",
    but there is no complete stack trace information.

    I have read a lot of information, which shows that Unity crashes often have complete stack trace information, such as:
    Obtained XXX stack frames.
    #0 0x007f509d4c0600 in _L_unlock_13
    #1 0x007f509af778e7 in GC_mark_from
    #2 0x007f509af728b9 in GC_mark_some

    ………………

    So my question is, how can I obtain the complete stack trace information when my Linux server crashes? Without this stack trace information, I won't be able to solve the bugs in my project.
    Thank you very much for your help.
     
  2. Ann_17

    Ann_17

    Joined:
    Apr 9, 2021
    Posts:
    3
    "Just to add, the Unity version I'm using is 2021.3.5f1."
     
  3. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    613
    > So my question is, how can I obtain the complete stack trace information when my Linux server crashes? Without this stack trace information, I won't be able to solve the bugs in my project.

    There is a chance that it is the complete stacktrace.

    Not all the crashes are the same. If it was a crash or more precisely uncaught exception in your C# code you probably would have seen a nicer looking stacktrace.

    But your application doesn't contain just your C# code, it also contains the code for Unity engine itself. If C++ parts of Unity engine crash, the amount of stuff you see might be significantly less and it might not make sense to you unless you are one of Unity Engineers. What's more unity engine probably has multiple threads, if a helper thread crashes even best stacktrace assuming everything was compiled with full debug info might be very short. The thread which crashed isn't even guaranteed to be the one that caused the problem. One thread corrupting memory can cause other threads to crash.

    One more factor that can decrease quality of stackraces is the fact that assuming something really went wrong in the C++ part of engine and it corrupted the memory it's not unusual for it to overwrite the stack including parts that are necessary to produce stacktrace. Can't produce meaningful stacktrace if crash was caused by something corrupting the stack.
     
  4. Ann_17

    Ann_17

    Joined:
    Apr 9, 2021
    Posts:
    3
    I'm not sure what caused my crash, it could be the C++ part of the engine or a certain Unity plugin. However, I have received a stack trace once before that showed the calling path in C#, indicating that the crash was caused by a certain plugin.

    Therefore, I personally feel that having stack traces included in the log file when Unity crashes would be helpful in solving the problem. At present, I have no idea how to fix the crash issue.