How to debug an app crash?

Hello,

Sorry for again asking about this, but I still can’t wrap my head around how to debug an app crash.

I have built and plugged a new C# plugin in my dev environment, and my app now crashes pretty often. So I’m pretty sure the crash is caused by this new plugin.
However, when the app crashes, I have zero logs that indicate that anything went wrong (apart from the “app crashed” messages in both ServerTrace and Trace logs). I would expect to see an exception of some sort, an error, or something, but I couldn’t find anything.

So I have several questions:

  • What happens exactly when an app crashes? Is it Overwolf itself that decides that the app needs to be crashed because some metrics cross a threshold, or because it deems the app to be in an incorrect state? Or does the app process crash “on its own”, and Overwolf just sees the crash without having any role in it?
  • Do I have a way to get some info about what caused the crash (I do have the onUncaughtException handler listening)?
1 Like

@sebastientromp

In some case (if the app crash caused by plugin or native CEF) a dump file can be created.

The dump names should be: BROWSER_CRASH and BROWSER_ERROR and you will find these files at: %localappdata%\Overwolf\User Data\Crashpad\reports.

Thanks, I was looking for crash reports, but could not find them :slight_smile:

Though in my case, the reports weren’t present even though the crash was caused by the c# plugin (I’ve since then been able to figure out what piece of code was causing the crash).

Hey @eransharv, sorry to untick to reply as a solution, but it only partially addresses the initial questions.
Finding out why my app is crashing has been proving very challenging from the start, and I really would like to understand as much as possible how app crashes work:

  1. Does OW itself decides that an app crashes? Or does the app crash on its own, and OW just reports it?
  2. What creates the dump file? What causes it to be created? Why isn’t it always created?

At the moment, my app crashes are mostly logs where everything is going well, then a line that says that the app crashed in ServerTrace / Trace logs, and nothing more, so I feel powerless in understanding what is happening and fixing it.

Thanks for your help :slight_smile:

@tom.wolf can you please elaborate on the issue?

Hi,
“Does OW itself decides that an app crashes? Or does the app crash on its own, and OW just reports it?”

– No, OW doesn’t decide itself. Each app runs in its own isolated process (OverwolfBrowser.exe). An app that utilizes a C# plugin, has the plugin’s code running in the context of it’s isolated process - so if the plugin crashes, the app’s process crashes and this is detected by the Overwolf.exe process (then you see a message/log about it)

What creates the dump file? What causes it to be created? Why isn’t it always created?

– The Chromium engine that OW uses tries to create a dump file (when possible). In your case, as far as I know, it might not create a dump file for your scenario (crash on load).

Usually - there will also be an extra log file with the prefix of: BrowserCrash_ (again, not always) and then we can get more information about the problem.

If you are experiencing many crashes - I’d suggest to create an isolated process for your plugin - he is one way of doing this:

  1. Create an exe program that uses your plugin/implements the plugin by itself
  2. Expose a communication channel (websockets/http server) to this process so that your web app can easily communicate with it
  3. Use our overwolf-plugins/plugins/process_manager at master · overwolf/overwolf-plugins · GitHub plugin to launch and monitor the process from within your app (if it crashes, you will know)

Let’s hope the process_manager doesn’t crash :slight_smile:

2 Likes

Thanks for the details Tom, really appreciated :slight_smile:

Just to be sure - running the plugin in another process will reduce the impact of crashes on the app, but it won’t solve them or make investigation easier, will it?

That is correct - it will not impact your app, so you can try to restart it (with a limit on the retries) when it crashes.
It will also allow you to add your own dump collection code to your process - so that could help, potentially.

Ok. In this case the crash happens all the time when creating the plugin apparently - the few users who reported crashes mentioned that the app would never start, the restarting the app probably won’t help.

I mean restarting the plugin process (not the app).
But if these users will always get a crash upon the plugin’s startup, then yes, it won’t help - but at least you can give them an appropriate message and even ask them to communicate the issue on Discord.

So, I strongly suggest you take this path.

@sebastientromp i marked Tom’s answer as a solution, so it wil be usefull as a general guidance for other users. Anyway we will keep the discussion on your specific use case here or on slack.

Thanks for the details, really appreciated :slight_smile:
A.Rrajani Photography