Crash at startup: java.lang.NullPointerException at org.mozilla.gecko.GeckoApp$SessionSnapshotRunnable.run

RESOLVED FIXED in Firefox 13

Status

()

--
critical
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

({crash})

unspecified
Firefox 13
ARM
Android
crash
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [native-crash])

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Full stack trace:
E/AndroidRuntime( 4034): FATAL EXCEPTION: main
E/AndroidRuntime( 4034): java.lang.RuntimeException: Unable to pause activity {org.mozilla.fennec_mh/org.mozilla.fennec_mh.App}: java.lang.NullPointerException
E/AndroidRuntime( 4034): 	at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2354)
E/AndroidRuntime( 4034): 	at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2311)
E/AndroidRuntime( 4034): 	at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2291)
E/AndroidRuntime( 4034): 	at android.app.ActivityThread.access$1700(ActivityThread.java:117)
E/AndroidRuntime( 4034): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:938)
E/AndroidRuntime( 4034): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 4034): 	at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 4034): 	at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 4034): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4034): 	at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 4034): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 4034): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
E/AndroidRuntime( 4034): 	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 4034): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 4034): 	at org.mozilla.gecko.GeckoApp$SessionSnapshotRunnable.run(GeckoApp.java:577)
E/AndroidRuntime( 4034): 	at org.mozilla.gecko.GeckoApp.onSaveInstanceState(GeckoApp.java:561)
E/AndroidRuntime( 4034): 	at android.app.Activity.performSaveInstanceState(Activity.java:1037)
E/AndroidRuntime( 4034): 	at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1181)
E/AndroidRuntime( 4034): 	at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2336)
E/AndroidRuntime( 4034): 	... 12 more

As far as I can tell from Log.w() debugging, org.mozilla.gecko.GeckoApp$SessionSnapshotRunnable.run is called before GeckoApp.initialize, so mSoftwareLayerClient is still null. This happens on an (old) linaro android build running on a pandaboard, based on android 2.3.4.
(Assignee)

Comment 1

7 years ago
Created attachment 598862 [details] [diff] [review]
NULL-check mSoftwareLayerClient in GeckoApp$SessionSnapshotRunnable.run

I don't know if this is the right fix, but with this, fennec starts on my pandaboard.
Attachment #598862 - Flags: review?(mark.finkle)

Updated

7 years ago
Severity: normal → critical
Keywords: crash
Hardware: All → ARM
Whiteboard: [native-crash]
Comment on attachment 598862 [details] [diff] [review]
NULL-check mSoftwareLayerClient in GeckoApp$SessionSnapshotRunnable.run


>diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java

>         public void run() {
>+            if (mSoftwareLayerClient == null)
>+                return;
>             synchronized (mSoftwareLayerClient) {

nit: add a blank line before the synchronized

I guess we are getting a "pause" before we are initialized.
Attachment #598862 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/4b2b0f2b92b8
Assignee: nobody → mh+mozilla
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
You need to log in before you can comment on or make changes to this bug.