3

First of all thanks in advance....i hope you can help me, i am a bit lost in this.

I am asking here besides there is a lost of threads talking about this, because i do not find a solution here neither in internet.... it seems to happen 99% on Samsung devices, since 4.2 version. And i really hope i am not the first one asking this and you can give me an answer, whatever is good or bad :). But i do not know if it is a Samsung issue or general, i also have seen it in other devices but only a few crashes...in samsung is thousands... ¿?¿?

We have in our apps crashlitycs integrated, and from some time ago, we started to receive different crashes, but we do not even know if they are crashes for real or not. The exception is being throw is:

Fatal Exception: java.util.concurrent.TimeoutException
com.android.internal.os.BinderInternal$GcWatcher.finalize() timed out after 10 seconds

It happens in different objects: BinderInternal, Binder, NativeDecimalFormat, BinderProxy, CloseGuard, WindowsCursor etc.

This did not happen before...and when i am trying to look in internet i just get a lot people is affected but there is no solution.

My biggest fear is....when is happening? is crashing people when using the app or just in background? is it crashing with the Android OS message "the app stopped suddenly"? or is something internal i can "ignore" ?

Is it happening all days a lot times every day, is it constant....but we cannot reproduce it anyway.......do you know what is this?

I give you some links they talk about garbage collector issue, or bad finalize/internet call issue....

How to handle :java.util.concurrent.TimeoutException: android.os.BinderProxy.finalize() timed out after 10 seconds errors?

https://www.reddit.com/r/androiddev/comments/3am3yb/some_crash_reports_have_nothing_to_do_with_my_app/

https://github.com/andstatus/andstatus/issues/301

http://openstackwiki.org/wiki/Java.util.concurrent.TimeoutException_(android.media.MediaMetadataRetriever.finalize)_Zeit%C3%BCberschreitung_nach_10_Sekunden

Cœur
  • 37,241
  • 25
  • 195
  • 267
Rako
  • 81
  • 1
  • 7

1 Answers1

2

We solved the problem by stopping the FinalizerWatchdogDaemon.

public static void fix() {
    try {
        Class clazz = Class.forName("java.lang.Daemons$FinalizerWatchdogDaemon");

        Method method = clazz.getSuperclass().getDeclaredMethod("stop");
        method.setAccessible(true);

        Field field = clazz.getDeclaredField("INSTANCE");
        field.setAccessible(true);

        method.invoke(field.get(null));

    }
    catch (Throwable e) {
        e.printStackTrace();
    }
}

You can call the method in Application's lifecycle, like attachBaseContext(). For the same reason, you also can specific the phone's manufacture to fix the problem, it's up to you.

Enaoi
  • 449
  • 4
  • 6