java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$<n>.run(GeckoApp.java)

RESOLVED FIXED in Firefox 17

Status

()

defect
--
critical
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: scoobidiver, Assigned: Margaret)

Tracking

({crash, regression})

17 Branch
Firefox 18
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox17 fixed)

Details

(Whiteboard: [native-crash][startupcrash], crash signature)

Attachments

(2 attachments)

There's one crash in 17.0a1/20120801: bp-f938e0f1-2984-4eca-9072-deb3a2120801.

java.lang.NullPointerException
	at org.mozilla.gecko.GeckoApp$8.run(GeckoApp.java:1018)
	at android.os.Handler.handleCallback(Handler.java:615)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4896)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.GeckoApp%248.run%28GeckoApp.java%29
Is it sufficient to check that menu isn't null above this line? It looks like we're setting mMenu in onCreateOptionsMenu, then inflating the layout inside it afterwards, so maybe this Runnable is running in between those two things happening.

http://hg.mozilla.org/mozilla-central/file/582d4c67b3a7/mobile/android/base/GeckoApp.java#l448
This could happen for webapps which does not have the "char encoding" menu item.
There's spike in crashes starting from 17.0a1/20120824101755. The regression range for the spike is:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5650196a8c7d&tochange=f2146a6c104e
Keywords: regression
Whiteboard: [native-crash] → [native-crash][startupcrash]
Version: Trunk → Firefox 17
More reports also at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.GeckoApp%244.run%28GeckoApp.java%29
Crash Signature: [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$8.run(GeckoApp.java)] → [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$8.run(GeckoApp.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$4.run(GeckoApp.java)]
Summary: java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$8.run(GeckoApp.java) → java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$<n>.run(GeckoApp.java)
There may have been a recent spike because of the increase in WebApps testing.

Unfortunately, I wasn't able to reproduce the crash, so this is a speculative fix, but I think it's something we should do anyway.
Assignee: nobody → margaret.leibovic
Attachment #655776 - Flags: review?(sriram)
Comment on attachment 655776 [details] [diff] [review]
move character encoding menu logic to BrowserApp

Review of attachment 655776 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me as per https://bugzilla.mozilla.org/show_bug.cgi?id=779741#c3
Attachment #655776 - Flags: review?(sriram) → review+
https://hg.mozilla.org/mozilla-central/rev/4a09ef58cba1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
It's not fixed. See bp-fbdf67bc-943b-4ae5-82aa-4ca312120829.
Status: RESOLVED → REOPENED
Crash Signature: [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$8.run(GeckoApp.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$4.run(GeckoApp.java)] → [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$8.run(GeckoApp.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$4.run(GeckoApp.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$3.run(GeckoApp…
Resolution: FIXED → ---
(In reply to Scoobidiver from comment #10)
> It's not fixed. See bp-fbdf67bc-943b-4ae5-82aa-4ca312120829.

This is a call to get a different menuitem:
http://hg.mozilla.org/mozilla-central/file/790fb17b1fe3/mobile/android/base/GeckoApp.java#l900

But the same idea applies. We should take a look through GeckoApp and move BrowserApp-depdendent menuitem logic over to BrowserApp.
This is the only other menu.findItem() call I see in GeckoApp, so I think we should be good after this.

I didn't realize it at first, but the events we register for in GeckoApp first get handled by BrowserApp's handleMessage, so I didn't need to change any (un)registerEventListener calls for this to work.
Attachment #656546 - Flags: review?(wjohnston)
Attachment #656546 - Flags: review?(wjohnston) → review+
https://hg.mozilla.org/mozilla-central/rev/bad853c6b1e5
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
I think it should land in Aurora.
Comment on attachment 655776 [details] [diff] [review]
move character encoding menu logic to BrowserApp

[Approval Request Comment]
Bug caused by (feature/regressing bug #): n/a
User impact if declined: crashes
Testing completed (on m-c, etc.): landed on m-c 8/28 
Risk to taking this patch (and alternatives if risky): low-risk, moving BrowserApp-specific logic out of GeckoApp
String or UUID changes made by this patch: n/a
Attachment #655776 - Flags: approval-mozilla-aurora?
Comment on attachment 656546 [details] [diff] [review]
(Part 2) enable "Settings" menuitem in BrowserApp, not GeckoApp

[Approval Request Comment]
Bug caused by (feature/regressing bug #): n/a
User impact if declined: crashes
Testing completed (on m-c, etc.): landed on m-c 8/30 
Risk to taking this patch (and alternatives if risky): low-risk, moving BrowserApp-specific logic out of GeckoApp
String or UUID changes made by this patch: n/a
Attachment #656546 - Flags: approval-mozilla-aurora?
Attachment #655776 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Attachment #656546 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.