Search Unity

Unity Editor and Build crash on exceptions

Discussion in 'macOS' started by TalespinJoe, Dec 28, 2020.

  1. TalespinJoe

    TalespinJoe

    Joined:
    Aug 20, 2018
    Posts:
    28
    We are currently having some issues where, on OSX, some exceptions cause the entire application to crash. While on Windows, we would get an error stating what exception occurred with a stack trace.

    The problem is, it doesn't seem to happen all of the time (but it does consistently on the same exception). If I would try to make a simple replication of the error, for example not linking in a prefab and still trying to use it, or not assigning an instance to a class and use it, it throws the error just fine.

    I started digging around to see if I can find a cause for this, but no luck so far. So I am hoping perhaps people here have encountered similar issues, or perhaps have some general pointers to start looking at.

    This happens both in builds (both release and develop builds) and in the Unity Editor (which causes the entire editor to crash as a result).

    Might also be good to note, that the app crashes before writing the stack trace, so if we wouldn't have windows to check, we would be in the dark on finding out where the crash occurred.

    Maybe also worth noting is that we us 2019.4.1f1 and we have Cloud Diagnostics enabled.

    Any help or pointer would be greatly appreciated!
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Do you happen to have a player/editor log from a crashing application?
     
  3. TalespinJoe

    TalespinJoe

    Joined:
    Aug 20, 2018
    Posts:
    28
    Sure, I attached the editor log (I also have a crash report from Apple, if that would help)

    This happens on all our apple machines and both in Editor as the build.

    It always crashes before it can print the actual error (which it does on Windows).
     

    Attached Files:

  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Does it show up similarly in the player when it crashes? Or does the log look differently there?
     
  5. TalespinJoe

    TalespinJoe

    Joined:
    Aug 20, 2018
    Posts:
    28
    Yes, essentially the same. I have attached them here as well. (Slightly older build, same issue that caused the crash)
     

    Attached Files:

  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Would you be able to report a bug on this? Looks like it might be memory corruption but can't really know what is causing it from just that callstack. It could be something in your project, it could be something in Unity.
     
  7. TalespinJoe

    TalespinJoe

    Joined:
    Aug 20, 2018
    Posts:
    28
    Thanks for checking. I will have to check if I can make a bug with the project attached due to company policy/legal stuff etc.

    Meanwhile I have been digging a little deeper to see if I can find something where this might happen and why. I have some leads and perhaps I can make a simple repro project for it. Will keep you posted here if I find something.
     
  8. TalespinJoe

    TalespinJoe

    Joined:
    Aug 20, 2018
    Posts:
    28
    @Tautvydas-Zilys I did some more testing and the issue seems to happen when we instantiate a prefab that leads to a null-ref.

    However, the actually crash occurs on a script that is not directly associated with any (direct or indirect) scripts on the prefab, so I'm a bit confused why that happens. I have included the call stack from Visual Studio Code, perhaps it is helpful as I am not able to upload our entire project for a bug report and I can't seem to replicate this in a fresh project either. So I am going to assume this might be something from our side.

    Screenshot 2021-01-08 at 16.35.51.png
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    The problem with memory corruptions is that they often crash later than the corruption happening in seemingly innocent code :/.