java.lang.NullPointerException: at org.mozilla.gecko.db.LocalBrowserDB.isReadingListItem(LocalBrowserDB.java)

RESOLVED FIXED in Firefox 19

Status

()

Firefox for Android
General
--
critical
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Scoobidiver (away), Unassigned)

Tracking

({crash})

Trunk
Firefox 19
ARM
Android
crash
Points:
---

Firefox Tracking Flags

(firefox16 affected, firefox17 affected, firefox18 affected)

Details

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

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
There are two crashes, one in 16.0a2/20120826, one in 17.0a2/20120828: bp-ab532a22-9011-44f4-8a71-1caa22120828.

java.lang.NullPointerException
	at org.mozilla.gecko.db.LocalBrowserDB.isReadingListItem(LocalBrowserDB.java:427)
	at org.mozilla.gecko.db.BrowserDB.isReadingListItem(BrowserDB.java:146)
	at org.mozilla.gecko.Tab$6.doInBackground(Tab.java:372)
	at org.mozilla.gecko.Tab$6.doInBackground(Tab.java:367)
	at org.mozilla.gecko.util.GeckoAsyncTask$BackgroundTaskRunnable.run(GeckoAsyncTask.java:34)
	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 org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.db.LocalBrowserDB.isReadingListItem%28LocalBrowserDB.java%29
Lucas, this crash is in reading list DB code.

Comment 2

6 years ago
This looks like the same issue we had in bug 765486, but we just fixed that with a null check :/
(Reporter)

Comment 3

6 years ago
There are recent crashes in the trunk: bp-ecfe42b9-c3c0-4ec7-b8c5-c48b02121004.
Version: Firefox 17 → Trunk
(Reporter)

Updated

6 years ago
status-firefox16: --- → affected
status-firefox17: --- → affected
status-firefox18: --- → affected
status-firefox19: --- → affected
Created attachment 681929 [details] [diff] [review]
Protect isReadingListItem against null cursors
Attachment #681929 - Flags: review?(mark.finkle)
Ok, I'm taking a pragmatic approach here given that this bug feels very obscure. This patch protects us from the NPE just like the patch for bug 765486 did.
Comment on attachment 681929 [details] [diff] [review]
Protect isReadingListItem against null cursors

A quick look at the ContentResolver.query code shows more than a few reasons to get a null back.
Attachment #681929 - Flags: review?(mark.finkle) → review+
(In reply to Mark Finkle (:mfinkle) from comment #6)
> Comment on attachment 681929 [details] [diff] [review]
> Protect isReadingListItem against null cursors
> 
> A quick look at the ContentResolver.query code shows more than a few reasons
> to get a null back.

Yeah, if the query() call returns a null cursor, this means something really bad happened (which shouldn't be so frequent anyway).
https://hg.mozilla.org/mozilla-central/rev/bb8baf35a273
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
(Reporter)

Updated

6 years ago
status-firefox19: affected → ---
You need to log in before you can comment on or make changes to this bug.