Search Unity

What is the Unity Crash Handler? Do I need it?

Discussion in 'Editor & General Support' started by Marscaleb, Jul 10, 2020.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    When I create my standalone build for my game, it creates two programs: one is the actual game and the other is a "Unity Crash Handler 64"
    What does this crash handler do? Do I need it or could I delete it before I try to distribute my game?
    I double-clicked on it by accident a couple times and nothing seemed to open.
     
  2. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    If the game crashes it shows the user a popup and it can send a report back to the developer.
     
  3. henrimh

    henrimh

    Joined:
    Mar 15, 2016
    Posts:
    3
    Hey, do you guys know how Unity starts the crash handler process? Using what API? I'd like to disable the launch of the process completely.
     
  4. LonelyDuck

    LonelyDuck

    Joined:
    Jul 13, 2021
    Posts:
    1
    So this "UnityCrashHandler" when crashing the game, sends that information to the game developer, as Unreal Engine ???
    upload_2021-7-28_18-5-4.png
     

    Attached Files:

  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    It sends data to the developer if they're using Unity Cloud Diagnostics. It also captures the dump file of the crash game and writes it to disk, even the game developer hasn't configured anything (so you could send it to them manually).

    If you delete it, Unity crash handler will not launch (obviously!), but I'm not sure why you'd want to do that as then investigating crashes in the wild becomes 10x harder.
     
    v01pe_ likes this.
  6. Zarkow

    Zarkow

    Joined:
    Jul 27, 2015
    Posts:
    92
    I am not seeing what is described in this thread. There is no pop-up informing the user that an exception/crash happened, the game keeps chugging along. Yes, a report is sent to Cloud Diagnostics, which is usually partially useless it the lacks a proper stacktrace. But once an exception occur in a run if often happens again - had a report come in that the same exception was listed over 600 times, as it was triggered every frame. The player had no idea and wondered by his unit wasn´t responding as it should. A crash would atleast have let him know...
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    The crash handler only handles hard application crashes, not C# exceptions in your code. You can subscribe to this event to react to unexpected C# exceptions: https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.unhandledexception?view=net-5.0
     
    Joe-Censored likes this.
  8. Zarkow

    Zarkow

    Joined:
    Jul 27, 2015
    Posts:
    92
    Already tried this, but it doesn't work as the UnityEngine.CrashReportHandler.CrashReportHandler already grabs the exception.

    The only, very-very dirty way today, as CrashReportHandler doesn't have an event, is to subscribe to:
    Application.RegisterLogCallback(new Application.LogCallback(HandleLog));

    And in the callback filter on any LogType.Exception and then handle ones cleanup (go back to main menu or whatever it is one want to do).
     
    Elledan3101 likes this.
  9. Elledan3101

    Elledan3101

    Joined:
    May 24, 2013
    Posts:
    18
    yep! I have the same problem.
    I need to subscribe to something to update data in "CrashReportHandler.SetUserMetadata", but can't find any event I could use before Unity handle a crash or any exception