Unclosed Cursor warning in Fennec Native

VERIFIED FIXED

Status

()

Firefox for Android
General
P3
normal
VERIFIED FIXED
6 years ago
5 years ago

People

(Reporter: kats, Assigned: lucasr)

Tracking

unspecified
All
Android
Points:
---

Firefox Tracking Flags

(firefox11 fixed, fennec11+)

Details

Attachments

(1 attachment)

Happening on latest birch (rev 9999a423d8ab) running on a Droid Pro. I just loaded TechCrunch.com and saw this in the logcat output.

11-18 10:07:49.271  9038  9039 E Cursor  : Finalizing a Cursor that has not been deactivated or closed. database = /data/data/org.mozilla.fennec_kats/databases/favicon_urls.db, table = favicon_urls, query = SELECT favicon_url FROM favicon_urls WHERE (page_url = ?)
11-18 10:07:49.271  9038  9039 E Cursor  : android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteCursor.<init>(SQLiteCursor.java:210)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1350)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:280)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at org.mozilla.gecko.Favicons$DatabaseHelper.getFaviconUrlForPageUrl(Favicons.java:128)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at org.mozilla.gecko.Favicons$LoadFaviconTask.doInBackground(Favicons.java:371)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at org.mozilla.gecko.Favicons$LoadFaviconTask.doInBackground(Favicons.java:215)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at android.os.AsyncTask$2.call(AsyncTask.java:185)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
11-18 10:07:49.271  9038  9039 E Cursor  : 	at java.lang.Thread.run(Thread.java:1096)
(Assignee)

Comment 1

6 years ago
Created attachment 575470 [details] [diff] [review]
Close cursor when getting favicon URL
Assignee: nobody → lucasr.at.mozilla
Attachment #575470 - Flags: review?(kgupta)
Comment on attachment 575470 [details] [diff] [review]
Close cursor when getting favicon URL

I'd prefer to see something like https://wiki.mozilla.org/Fennec/NativeUI/CodingStyle#Closing_resources - although if you want to do that in a separate patch i can r+ this one.
(Assignee)

Comment 3

6 years ago
(In reply to Kartikaya Gupta (:kats) from comment #2)
> Comment on attachment 575470 [details] [diff] [review] [diff] [details] [review]
> Close cursor when getting favicon URL
> 
> I'd prefer to see something like
> https://wiki.mozilla.org/Fennec/NativeUI/CodingStyle#Closing_resources -
> although if you want to do that in a separate patch i can r+ this one.

r+ this one and I'll upload a separate patch refactoring the other parts of the Favicons to follow the suggested idiom.
Attachment #575470 - Flags: review?(kgupta) → review+
Lucas - can we land/close this bug?
Priority: -- → P3
(Assignee)

Comment 5

6 years ago
Pushed: http://hg.mozilla.org/projects/birch/rev/c26b7a14e5bd

Kats, I filed bug 704466 to track the promised refactoring.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Comment 6

6 years ago
Is there a way we can verify this?

Comment 7

6 years ago
I loaded TechCrunch.com and looked in aLogcat but there was no unclosed cursor warning. 
Marking as verified fixed, build: Mozilla /5.0 (Android;Linux armv7l;rv:9.0a1) Gecko/20111123 Firefox/10.0a1 Fennec/10.0a1 
Device: LG Optimus 2X (Android 2.2)
Status: RESOLVED → VERIFIED
tracking-fennec: --- → 11+
status-firefox11: --- → fixed
You need to log in before you can comment on or make changes to this bug.