Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Discussion Feature for more detailed feedback on crash

Discussion in 'General Discussion' started by saifshk17, Jun 16, 2023.

  1. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    485
    I am a developer and have been using Unity since 5-6 years now. When I have a Unity crash, I go to the logs to read what went wrong or if I wish to see if there was an error, I enable the "Development Build" in the build settings. This is how I know what went wrong.
    But imagine if there was a non developer or just a newbie in Unity side of things, that person would have a terrible time to search through logs to see why the Unity crashed.

    My request is quite simple (if possible to implement):
    Don't close the Unity application when there is a crash, show in the screen with simple texts what happened?
    If there was a graphics issue, memory out of bounds, too slow, etc. Anything related to why the crash happened. It makes it so simple and easy for the user to understand and track what went wrong. I understand that windows applications (.exe) just crashes or freezes up. If possible, when the memory is about to go out of bounds, just switch the scene to something plain and empty and just show the error there.
     
    Unifikation likes this.
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    How many apps do that in a useful way?

    Hint: the number is very close to zero.

    An app crashes when an unrecoverable error occured. You can post that error in the log, and if go through great lengths, you could even show that error in a dialog box (the great lengths being: what if the crash made it impossible to show that dialog box? This may cause an endless stream of messages, hiding the actual error or even bringing down the entire system).

    Anyway, that message would still read something like this:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. CodeSmile.ProTiler.Runtime.CodeDesign.v4.GridMap.GridMapBaseBehaviour`1[T].DeserializeMap () (at Assets/CodeSmile/ProTiler/Runtime/CodeDesign/v4.cs:43)
    3. CodeSmile.ProTiler.Runtime.CodeDesign.v4.GridMap.GridMapBaseBehaviour`1[T].OnAfterDeserialize () (at Assets/CodeSmile/ProTiler/Runtime/CodeDesign/v4.cs:37)
    This isn't going to be more helpful. Yet this NullReference thing is going to be accountable for 90% of the causes of a Unity app crashing.

    Another 9.9% come from some other top five exception types. MissingReferenceException most certainly one of them.

    Then very rarely a Unity app might crash for other reasons such as graphics, but this may simply be caused by a faulty driver or hardware. The app doesn't know this. It doesn't even have any chance of knowing about this.
     
    saifshk17 likes this.
  3. ismart22

    ismart22

    Joined:
    Jun 20, 2023
    Posts:
    2
    I would have found this feature very useful too, thanks
     
    Last edited: Jul 17, 2023
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,082
    A crash by definition is an application that stops functioning property and exits which means it wouldn't be a crash if it could just keep running. Also the exit is typically enforced by the operation system not the application itself so you can't really stop it. What you could do is automatically re-open it.
     
  5. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    643
    I agree and I think this is a classic case of something so obvious to the développers that they forget that it's not to anyone else.

    Since the crash automatically open the bug report window and select the log file, offering to open it in one click would be very convenient for little cost.

    I'd be more likely to send a bug report if I was given informations about what happened.
     
    Unifikation, Ruslank100 and saifshk17 like this.
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,503
    You could also offer to open the latest logs on Editor startup if the last session didn't exit properly, which would be sweet, actually.
     
  7. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    485
    I am not saying that there are no solutions. And I have also mentioned that all windows apps close unexpectedly when there is an error. I am just offering a "maybe" solution or if there could be a better implementation. This is just something that could be improved, since many of the technologies are advancing, this is something that can be looked through.