Android crash reporting of asserts

I noticed that our Backtrace dashboard did not have any asserts for Android, only IOS/Windows. I pinpointed this to Android’s RequestExit implementation, which simply calls exit(). IOS’s implementation calls abort(), which does get picked up by the crash handler and uploaded to crash reporting.

This can be fixed by having FAndroidMisc::RequestExit’s forced exit call abort() as well, but this seems too simple. Is there a reason why Android is configured differently than other platforms?

Steps to Reproduce

  1. Have a project set up for crash reporting
  2. Trigger an assert

Hi Camille,

Can you confirm which backtrace dashboard you are referring to? As far as I can tell, RequestExit calls into GameActivity’s AndroidThunkJava_ForceQuit and System.exit(0) as the Java level. I don’t see any major issue in moving to abort, however, I don’t believe the Engine implementation would move to that based on feedback from the dev team.

Best regards.

Hi Camille,

The call to:

public void AndroidThunkJava_ForceQuit() { //$${gameActivityForceQuitAdditions}$$ System.exit(0); // finish(); }is purposeful based on my conversations with the development team. Would Backtrace detect a non zero exit code? (i.e. System.exit(-1))

Best regards.

Thanks for the update Camille, that’s unfortunate. We’ll keep this in mind for the future and potentially bind an alternate abort based force quit path to a CVar.

Best regards.

I meant the commercial crash tracking solution named Backtrace. :slight_smile:

I contacted their support team to see if their SDK is supposed to be detecting these events, but Android asserts are the only thing not getting caught by it. Given the difference in methods for force quitting, that seemed like the outlier (vs IOS or Windows both calling some variant of abort()).

I was mainly curious, abort() works well but it seemed like exit() might’ve been an oversight. Unless you have some special handling set up internally, I’m not sure how a crash handling + reporting solution would be able to catch what otherwise appears like a legitimate exit() call…?

It doesn’t look like it, but if that’s working with whatever reporting solution you use for Android, then I’ll take that back up to Backtrace support. For now, the abort() workaround seems to be doing the trick for us. Thank you!