java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent/TopSitesView$<n>.onActivityResult

RESOLVED FIXED in Firefox 23

Status

()

--
critical
RESOLVED FIXED
6 years ago
2 years ago

People

(Reporter: scoobidiver, Assigned: wesj)

Tracking

({crash, regression, topcrash})

23 Branch
Firefox 25
ARM
Android
crash, regression, topcrash
Points:
---

Firefox Tracking Flags

(firefox20 unaffected, firefox21 affected, firefox22 unaffected, firefox23+ fixed, firefox24+ fixed, firefox25 fixed)

Details

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

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
There are two crashes in 21.0a1, one in 21.0a1/20130207 and one in 21.0a1/20130209, bp-ce2d4c11-918b-48e5-9435-e8b352130210.
It's similar to bug 825505.

java.lang.NullPointerException
	at org.mozilla.gecko.AboutHomeContent$17.onActivityResult(AboutHomeContent.java:1050)
	at org.mozilla.gecko.ActivityHandlerHelper.handleActivityResult(ActivityHandlerHelper.java:224)
	at org.mozilla.gecko.GeckoApp.onActivityResult(GeckoApp.java:2492)
	at org.mozilla.gecko.BrowserApp.onActivityResult(BrowserApp.java:361)
	at android.app.Activity.dispatchActivityResult(Activity.java:5347)
	at android.app.ActivityThread.deliverResults(ActivityThread.java:3175)
	at android.app.ActivityThread.handleSendResult(ActivityThread.java:3222)
	at android.app.ActivityThread.access$1100(ActivityThread.java:140)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1276)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4895)
	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:994)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
	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.AboutHomeContent%2417.onActivityResult%28AboutHomeContent.java%29
(Reporter)

Updated

6 years ago
status-firefox20: --- → affected
Keywords: regression
Version: Trunk → Firefox 20
(Reporter)

Comment 1

6 years ago
It seems to be restricted to Nightly.
status-firefox22: --- → affected
(Reporter)

Comment 2

6 years ago
(In reply to Scoobidiver from comment #1)
> It seems to be restricted to Nightly.
It occurs also on the Aurora channel.
status-firefox20: affected → unaffected
Version: Firefox 20 → Firefox 21
This stack trace looks like mTopSitesGrid.getChildAt() is returning null here:

https://hg.mozilla.org/mozilla-central/annotate/5dbcbd03d7ba/mobile/android/base/AboutHomeContent.java#l1049

Some calls in AboutHomeContent.java check whether mTopSitesGrid.getChildAt() returns null because "the grid view might get temporarily out of sync with the adapter refreshes (e.g. on device rotation". Does that mean *all* calls to mTopSitesGrid.getChildAt() should check for null return?

Updated

6 years ago
Duplicate of this bug: 862234

Comment 5

6 years ago
(In reply to Chris Peterson (:cpeterson) from comment #3)
> This stack trace looks like mTopSitesGrid.getChildAt() is returning null
> here:
> 
> https://hg.mozilla.org/mozilla-central/annotate/5dbcbd03d7ba/mobile/android/
> base/AboutHomeContent.java#l1049
> 
> Some calls in AboutHomeContent.java check whether mTopSitesGrid.getChildAt()
> returns null because "the grid view might get temporarily out of sync with
> the adapter refreshes (e.g. on device rotation". Does that mean *all* calls
> to mTopSitesGrid.getChildAt() should check for null return?

It sounds like a similar issue is happening in bug 863762 (and I think I've seen other similar sounding crashes in TopSitesView), so you may be right here.
(Reporter)

Updated

6 years ago
Crash Signature: [@ java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent$17.onActivityResult(AboutHomeContent.java)] → [@ java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent$17.onActivityResult(AboutHomeContent.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.widget.TopSitesView$8.onActivityResult(TopSitesView.java)]
status-firefox23: --- → affected
Summary: java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent$17.onActivityResult(AboutHomeContent.java) → java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent/TopSitesView$<n>.onActivityResult(AboutHomeContent.java)
(Reporter)

Updated

6 years ago
Crash Signature: [@ java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent$17.onActivityResult(AboutHomeContent.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.widget.TopSitesView$8.onActivityResult(TopSitesView.java)] → [@ java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent$17.onActivityResult(AboutHomeContent.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.widget.TopSitesView$8.onActivityResult(TopSitesView.java) ]

Comment 6

6 years ago
I started looking into this, but I haven't been able to reproduce (based on comment 3 I was trying to reproduce by rotating the device while editing a top site).

A null check on the result of getChildView() seems like a simple solution, but if we just bail in that case, editing that top site would fail, and that's a sucky experience. It would be better if we could figure out why getChildView() is retuning null, and see if we can do something to prevent that.
(Reporter)

Comment 7

6 years ago
It's currently #11 top crasher in 21.0 (was #49 in 21.0b8).
22.0a2 is unaffected and 23.0a1 stopped after 23.0a1/20130505. The working range is:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=c8e47b184aba&tochange=b109e2dbf03b
status-firefox22: affected → ---
status-firefox23: affected → unaffected
Summary: java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent/TopSitesView$<n>.onActivityResult(AboutHomeContent.java) → java.lang.NullPointerException: at org.mozilla.gecko.AboutHomeContent/TopSitesView$<n>.onActivityResult
Since only fx21 (release version) is affected, I don't think we'd do much here.
(Reporter)

Comment 9

6 years ago
It seems Nightly and Aurora are still affected: #15 in 21.0, #1 in 23.0a2, #39 in 24.0a1.

Here is the stack trace:
java.lang.NullPointerException
	at org.mozilla.gecko.widget.TopSitesView$8.onActivityResult(TopSitesView.java:622)
	at org.mozilla.gecko.ActivityHandlerHelper.handleActivityResult(ActivityHandlerHelper.java:231)
	at org.mozilla.gecko.GeckoApp.onActivityResult(GeckoApp.java:2233)
	at org.mozilla.gecko.BrowserApp.onActivityResult(BrowserApp.java:824)
	at android.app.Activity.dispatchActivityResult(Activity.java:5275)
	at android.app.ActivityThread.deliverResults(ActivityThread.java:3618)
	at android.app.ActivityThread.handleSendResult(ActivityThread.java:3672)
	at android.app.ActivityThread.access$1100(ActivityThread.java:151)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1379)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:155)
	at android.app.ActivityThread.main(ActivityThread.java:5485)
	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:1028)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
	at dalvik.system.NativeStart.main(Native Method)

See https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.widget.TopSitesView%248.onActivityResult%28TopSitesView.java%29
tracking-fennec: --- → ?
status-firefox23: unaffected → affected
status-firefox24: --- → affected
tracking-firefox23: --- → ?
Keywords: topcrash
tracking-firefox23: ? → +
Assignee: nobody → wjohnston
tracking-fennec: ? → 23+
(Reporter)

Comment 10

6 years ago
A comment says: "Viewing tabs".
(Reporter)

Comment 11

5 years ago
It's #28 crasher in 21.0, #19 in 23.0a2, and #47 in 24.0a1. 22.0 Beta is not affected.
tracking-fennec: 23+ → ?
status-firefox22: --- → unaffected
tracking-firefox23: + → ?
Keywords: topcrash
Since this appears to be declining, untracking for 23.
tracking-firefox23: ? → -
tracking-fennec: ? → -
(Reporter)

Updated

5 years ago
status-firefox25: --- → affected
(Reporter)

Comment 13

5 years ago
It's #1 top crasher in 23.0b1 (not yet released).

As stated in bug 862234, the new signature (widget.TopSitesView) first showed up in 23.0a1/20130409. In the worst case it occurs one build out of six so the regression range is:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=b5cb88ccd907&tochange=b1fb34b07c17
Whiteboard: [native-crash] → [native-crash][startupcrash]
(Reporter)

Comment 14

5 years ago
It's now #2 top crasher in 23.0a1 and also #1 in 24.0a2.

A comment says: "I added a page to the main menu, Mozilla has stopped working."
tracking-fennec: - → ?
tracking-firefox23: - → ?
Keywords: topcrash
Version: Firefox 21 → Firefox 23
(Reporter)

Comment 15

5 years ago
(In reply to Scoobidiver from comment #14)
> in 23.0a1
I meant 23.0b1.
Adding qawanted/steps-wanted to try related STR from comment 14.
Keywords: qawanted, steps-wanted
QA Contact: kbrosnan
(Reporter)

Comment 17

5 years ago
Here is the faulty line, https://mxr.mozilla.org/mozilla-beta/source/mobile/android/base/widget/TopSitesView.java#622, i.e. final TopSitesViewHolder holder = (TopSitesViewHolder) v.getTag().
(Assignee)

Comment 18

5 years ago
Created attachment 770299 [details] [diff] [review]
Bandaid

I don't love doing this. Trying to think of some better way to reproduce or test this...
Attachment #770299 - Flags: review?(mark.finkle)
Attachment #770299 - Flags: review?(mark.finkle) → review+

Updated

5 years ago
tracking-firefox23: ? → +
tracking-firefox24: --- → +

Updated

5 years ago
Keywords: qawanted
(Reporter)

Comment 19

5 years ago
Checked in?
Flags: needinfo?(wjohnston)
(Assignee)

Comment 21

5 years ago
landed the wrong version of this. backed out:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7997be475fe8
https://hg.mozilla.org/mozilla-central/rev/1277b7b3de0e
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
(Reporter)

Updated

5 years ago
status-firefox25: affected → fixed
(Reporter)

Comment 24

5 years ago
Uplift to Aurora and Beta?
Flags: needinfo?(wjohnston)
(Assignee)

Comment 25

5 years ago
Comment on attachment 770299 [details] [diff] [review]
Bandaid

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Lots of bugs
User impact if declined: Crashes that are hard to reproduce or diagnose
Testing completed (on m-c, etc.): Landed on mc a month ago. Apparently we haven't seen crashes since.
Risk to taking this patch (and alternatives if risky): Low risk. Just adds a null check and bails. The risk is that in some cases, we may not show the correct pin site dialog. Failing silently seems better than crashing.
String or IDL/UUID changes made by this patch: none.
Attachment #770299 - Flags: approval-mozilla-beta?
Attachment #770299 - Flags: approval-mozilla-aurora?
Comment on attachment 770299 [details] [diff] [review]
Bandaid

agreed.
Attachment #770299 - Flags: approval-mozilla-beta?
Attachment #770299 - Flags: approval-mozilla-beta+
Attachment #770299 - Flags: approval-mozilla-aurora?
Attachment #770299 - Flags: approval-mozilla-aurora+
Keywords: steps-wanted
(Assignee)

Updated

5 years ago
Flags: needinfo?(wjohnston)
tracking-fennec: ? → ---
You need to log in before you can comment on or make changes to this bug.