11

So there is bug that keeps coming up with out anything in the trace related to me, here is a sample trace:

java.lang.NullPointerException
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:2484)
at android.app.ActivityThread.access$1800(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:948)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3695)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)

The other traces are similar with only the line number varying: 2484, 2472, and 2476.

Also the 3 reports that mention the device mention: M865 Huawei Ascend II which should have 2.3 on it.

After looking through the source for 2.1 - 4.1 ( my app minSdk is 7 ) at the given line numbers these are the lines that could have thrown the error:

2.3.7 - line 2472

2.3.6 - line 2472

private final void handleStopActivity(IBinder token, boolean show, int configChanges) {
    ActivityClientRecord r = mActivities.get(token);
    r.activity.mConfigChangeFlags |= configChanges; // line 2472

    StopInfo info = new StopInfo();
    performStopActivityInner(r, info, show);
    ...

Any ideas what is causing this and how to prevent it?

Emil Davtyan
  • 13,808
  • 5
  • 44
  • 66
  • I have the same issue from my last update, any updates on this? – Mario Lenci Mar 12 '13 at 17:07
  • @MarioLenci I think it has something to do with low memory situations where the apps process has to be killed on the spot. Are you experiencing a lot of `OutOfMemory` exceptions? – Emil Davtyan Mar 13 '13 at 00:48
  • I wound't say a lot, but yes i have some OutOfMemory report on old phones. I guess i have to hunt for leaks then. Thanks – Mario Lenci Mar 13 '13 at 09:45
  • If you're still having this problem, please have a look [here](http://stackoverflow.com/questions/3513859/nullpointerexception-in-handlestopactivity-no-reference-to-my-code-in-stack-t/16555168#16555168). If not, please let me know, how you solved it ;) – MalaKa May 15 '13 at 01:07
  • @MalaKa I have not solved this issue, I believe it is an Android bug that comes up on older phones with limited resources. `ActivityClientRecord ` for the activity seems to be missing from the snippet that I posted so either the app does not start properly or the methods aren't synchronized correctly. I can't reproduce the issue so I can't really do anything about it. – Emil Davtyan May 15 '13 at 09:39
  • I've seen a very similar set of crashes reported via Crashlytics, all of which are on 2.3.x versions of Android, so it does sound like a bug in old Android versions. There's probably not a great deal that can be done about it... – Jonathan Caryl Oct 03 '13 at 15:42
  • Looking back at this, it seems it was reported as a bug for Android and "mysteriously resolved itself" (https://phabricator.wikimedia.org/T69736) – DigCamara Feb 26 '19 at 17:16

0 Answers0