Closed Bug 834386 Opened 9 years ago Closed 9 years ago

AboutHomeContent: Finalizing a Cursor that has not been deactivated or closed

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect)

15 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: mfinkle, Assigned: mfinkle)

References

Details

Attachments

(1 file)

E/StrictMode( 3291): Finalizing a Cursor that has not been deactivated or closed. database = /data/data/org.mozilla.fennec/files/mozilla/8pf3tj34.backup/browser.db, table = bookmarks, query = SELECT _id, url, title, position FROM bookmarks WHERE ((deleted = 0) AND (parent == ?)) ORDER BY position ASC LIMIT 6
E/StrictMode( 3291): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
E/StrictMode( 3291): 	at android.database.sqlite.SQLiteCursor.<init>(SQLiteCursor.java:98)
E/StrictMode( 3291): 	at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:50)
E/StrictMode( 3291): 	at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
E/StrictMode( 3291): 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:400)
E/StrictMode( 3291): 	at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:333)
E/StrictMode( 3291): 	at org.mozilla.fennec.db.BrowserProvider.query(BrowserProvider.java:2542)
E/StrictMode( 3291): 	at android.content.ContentProvider.query(ContentProvider.java:652)
E/StrictMode( 3291): 	at android.content.ContentProvider$Transport.query(ContentProvider.java:189)
E/StrictMode( 3291): 	at android.content.ContentResolver.query(ContentResolver.java:370)
E/StrictMode( 3291): 	at android.content.ContentResolver.query(ContentResolver.java:313)
E/StrictMode( 3291): 	at org.mozilla.gecko.db.LocalBrowserDB.getPinnedSites(LocalBrowserDB.java:1133)
E/StrictMode( 3291): 	at org.mozilla.gecko.db.BrowserDB.getTopSites(BrowserDB.java:134)
E/StrictMode( 3291): 	at org.mozilla.gecko.AboutHomeContent.loadTopSites(AboutHomeContent.java:306)
E/StrictMode( 3291): 	at org.mozilla.gecko.AboutHomeContent.access$500(AboutHomeContent.java:70)
E/StrictMode( 3291): 	at org.mozilla.gecko.AboutHomeContent$10.run(AboutHomeContent.java:444)
E/StrictMode( 3291): 	at android.os.Handler.handleCallback(Handler.java:615)
E/StrictMode( 3291): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/StrictMode( 3291): 	at android.os.Looper.loop(Looper.java:137)
E/StrictMode( 3291): 	at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31)
E/StrictMode( 3291): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E/StrictMode( 3291): java.lang.Throwable: Explicit termination method 'close' not called
E/StrictMode( 3291): 	at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E/StrictMode( 3291): 	at android.content.ContentResolver$CursorWrapperInner.<init>(ContentResolver.java:1835)
E/StrictMode( 3291): 	at android.content.ContentResolver.query(ContentResolver.java:392)
E/StrictMode( 3291): 	at android.content.ContentResolver.query(ContentResolver.java:313)
E/StrictMode( 3291): 	at org.mozilla.gecko.db.LocalBrowserDB.getPinnedSites(LocalBrowserDB.java:1133)
E/StrictMode( 3291): 	at org.mozilla.gecko.db.BrowserDB.getTopSites(BrowserDB.java:134)
E/StrictMode( 3291): 	at org.mozilla.gecko.AboutHomeContent.loadTopSites(AboutHomeContent.java:306)
E/StrictMode( 3291): 	at org.mozilla.gecko.AboutHomeContent.access$500(AboutHomeContent.java:70)
E/StrictMode( 3291): 	at org.mozilla.gecko.AboutHomeContent$10.run(AboutHomeContent.java:444)
E/StrictMode( 3291): 	at android.os.Handler.handleCallback(Handler.java:615)
E/StrictMode( 3291): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/StrictMode( 3291): 	at android.os.Looper.loop(Looper.java:137)
E/StrictMode( 3291): 	at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31)
W/CursorWrapperInner( 3291): Cursor finalized without prior close()
If I had to guess, I would point to this code:
http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/db/BrowserDB.java#308

We only seem to close the cursor if (c != null && c.getCount() > 0) but wouldn't a zero length cursor still need to be closed?
Attached patch patchSplinter Review
This patch seems to fix the error.
Assignee: nobody → mark.finkle
Attachment #706047 - Flags: review?(bnicholson)
Attachment #706047 - Flags: feedback+
Duplicate of this bug: 828058
Attachment #706047 - Flags: review?(bnicholson) → review+
https://hg.mozilla.org/mozilla-central/rev/26f84ce129d1
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.