Intermittent Android app crash with no error logs despite UncaughtExceptionHandler

106 views Asked by At

Difficult issue to explain here - I can't give a code example because if I knew where abouts in the code the issue is, I wouldn't need help. Anyway...

My application, very infrequently, bombs out with an "Unfortunately [Your awesome generally bug free application] has stopped" dialog, and - despite having an UncaughtExceptionHandler that seems to catch every other damn thing - I get nothing through my error reporting system.

I suspect it is to do with locked/frozen threads clashing in some way (I have been unable to avoid using multiple threaded stuff to achieve my goals), so I know that makes everything more difficult to pinpoint, I'm just wondering if there is a way to capture application state at the point where the "Unfortunately..." dialog appears so that I can dump the lot to text file(s), or if there is another ingenious way of debugging this?

I have seen other similar StackOverflow questions, but none which state they already have an UncaughtExceptionHandler in place.

Apologies for being vague.

1

There are 1 answers

0
HomerPlata On BEST ANSWER

I finally diagnosed the issue by appending all Logcat output to a file on the sdcard via:

String logcatFilePath = Environment.getExternalStorageDirectory().getPath() + "/output.log";
try {
    Runtime.getRuntime().exec("logcat -v time -f" + " " + logcatFilePath);
}
catch (IOException e1) {}

The offending entry was:

04-07 17:41:55.790 F/libc    (26292): Fatal signal 11 (SIGSEGV) at 0xff606080 (code=1), thread 26297 (GC)

Which, with the help of other existing StackOverflow questions/answers, has pointed me in the right direction (Native library issues).