Closed Bug 866150 Opened 7 years ago Closed 7 years ago

java.lang.IllegalStateException: attempt to re-open an already-closed object: android.database.sqlite.SQLiteQuery (mSql = SELECT _id, url, title FROM combined WHERE ((url NOT IN (SELECT url FROM bookmarks WHERE bookmarks.parent == ?)) AND ((url NOT LIK...

Categories

(Firefox for Android :: General, defect, critical)

23 Branch
ARM
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Firefox 23
Tracking Status
firefox22 --- unaffected
firefox23 + fixed

People

(Reporter: scoobidiver, Assigned: Margaret)

References

(Blocks 1 open bug)

Details

(Keywords: crash, regression, topcrash, Whiteboard: [native-crash])

Crash Data

Attachments

(1 file)

It has been hit by five users since 23.0a1/20130425. The regression range is:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=fef5f202b2dc&tochange=690b5e0f6562
It's a regression from either bug 860759 or bug 858994.

java.lang.IllegalStateException: attempt to re-open an already-closed object: android.database.sqlite.SQLiteQuery (mSql = SELECT _id, url, title FROM combined WHERE ((url NOT IN (SELECT url FROM bookmarks WHERE bookmarks.parent == ?)) AND ((url NOT LIKE ?))) GROUP BY url ORDER BY (CASE WHEN bookmark_id > -1 THEN 100 ELSE 0 END) + visits * MAX(1, 100 * 225 / ((date - 1366990934266) / 86400000*(date - 1366990934266) / 86400000 + 225))  DESC LIMIT 9) 
	at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:33)
	at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:82)
	at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:164)
	at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:147)
	at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:178)
	at android.database.CursorWrapper.moveToPosition(CursorWrapper.java:162)
	at android.database.CursorWrapper.moveToPosition(CursorWrapper.java:162)
	at android.database.CursorWrapper.moveToPosition(CursorWrapper.java:162)
	at org.mozilla.gecko.db.BrowserDB$TopSitesCursorWrapper.moveToPosition(BrowserDB.java:390)
	at org.mozilla.gecko.db.BrowserDB$TopSitesCursorWrapper.moveToFirst(BrowserDB.java:436)
	at org.mozilla.gecko.widget.TopSitesView.getTopSitesUrls(TopSitesView.java:251)
	at org.mozilla.gecko.widget.TopSitesView.access$700(TopSitesView.java:57)
	at org.mozilla.gecko.widget.TopSitesView$5.doInBackground(TopSitesView.java:334)
	at org.mozilla.gecko.widget.TopSitesView$5.doInBackground(TopSitesView.java:331)
	at org.mozilla.gecko.util.UiAsyncTask$BackgroundTaskRunnable.run(UiAsyncTask.java:48)
	at android.os.Handler.handleCallback(Handler.java:605)
	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:32)

java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteQuery: SELECT _id, url, title FROM combined WHERE ((url NOT IN (SELECT url FROM bookmarks WHERE bookmarks.parent == ?)) AND ((url NOT LIKE ?))) GROUP BY url ORDER BY (CASE WHEN bookmark_id > -1 THEN 100 ELSE 0 END) + visits * MAX(1, 100 * 225 / ((date - 1366974790339) / 86400000*(date - 1366974790339) / 86400000 + 225))  DESC LIMIT 6
	at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55)
	at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:58)
	at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:151)
	at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:124)
	at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:214)
	at android.database.CursorWrapper.moveToPosition(CursorWrapper.java:162)
	at android.database.CursorWrapper.moveToPosition(CursorWrapper.java:162)
	at android.database.CursorWrapper.moveToPosition(CursorWrapper.java:162)
	at org.mozilla.gecko.db.BrowserDB$TopSitesCursorWrapper.moveToPosition(BrowserDB.java:390)
	at org.mozilla.gecko.db.BrowserDB$TopSitesCursorWrapper.moveToFirst(BrowserDB.java:436)
	at org.mozilla.gecko.widget.TopSitesView.getTopSitesUrls(TopSitesView.java:251)
	at org.mozilla.gecko.widget.TopSitesView.access$700(TopSitesView.java:57)
	at org.mozilla.gecko.widget.TopSitesView$5.doInBackground(TopSitesView.java:334)
	at org.mozilla.gecko.widget.TopSitesView$5.doInBackground(TopSitesView.java:331)
	at org.mozilla.gecko.util.UiAsyncTask$BackgroundTaskRunnable.run(UiAsyncTask.java:48)
	at android.os.Handler.handleCallback(Handler.java:725)
	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:32)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.IllegalStateException%3A+attempt+to+re-open+an+already-closed+object%3A+android.database.sqlite.SQLiteQuery+%28mSql+%3D+SELECT+_id%2C+url%2C+title+FROM+combined+WHERE+%28%28url+NOT+IN+%28SELECT+url+FROM+bookmarks+WHERE+bookmarks.parent+%3D%3D+%3F%29%29+AND+%28%28url+NOT+LIK%2E%2E%2E
https://crash-stats.mozilla.com/report/list?signature=java.lang.IllegalStateException%3A+attempt+to+re-open+an+already-closed+object%3A+SQLiteQuery%3A+SELECT+_id%2C+url%2C+title+FROM+combined+WHERE+%28%28url+NOT+IN+%28SELECT+url+FROM+bookmarks+WHERE+bookmarks.parent+%3D%3D+%3F%29%29+AND+%28%28url+NOT+LIKE+%3F%29%29%29+GROUP+BY+url+ORDER+BY+%28C%2E%2E%2E
Sounds like bug 860759 more than bug 858994.
Blocks: 860759
Seems surprising if this is a new regression, rather than an existing timing issue. Is it possible that we're doing the DB migration while TopSitesView is iterating over a cursor? This error simply means that you have an update happening while a cursor is open. SQLite handily closes it for you.
It's #6 top crasher in 23.0a1.
Keywords: topcrash
I'll investigate this. I would hope migrations would run at some designated time before we start using the DB, but I don't know exactly how this is all implemented.
Assignee: nobody → margaret.leibovic
(In reply to Scoobidiver from comment #0)
> It has been hit by five users since 23.0a1/20130425. The regression range is:
> http://hg.mozilla.org/mozilla-central/
> pushloghtml?fromchange=fef5f202b2dc&tochange=690b5e0f6562
> It's a regression from either bug 860759 or bug 858994.

How certain are you of this regression range? I'm also suspicious of bug 865060, which landed the same day and touched code that closes this cursor.
I'm *extra* suspicious that the changeset there moved where we call getTopSitesUrls, which shows up in these stacks:
http://hg.mozilla.org/mozilla-central/diff/7190f15f3f68/mobile/android/base/widget/TopSitesView.java
Let's try reverting the changes from bug 865060 and see if the crashes go away.
Attachment #743364 - Flags: review?(bnicholson)
Blocks: 865060
No longer blocks: 860759
Attachment #743364 - Flags: review?(bnicholson) → review+
(In reply to :Margaret Leibovic from comment #5)
> How certain are you of this regression range? I'm also suspicious of bug
> 865060, which landed the same day and touched code that closes this cursor.
The spike is sharp, from 0 to 5 crashes in 23.0a1/20130425, so I am pretty confident of the range. Nevertheless, the two bugs in this range are just a guess so bug 865060 might be also a candidate for the regression.
https://hg.mozilla.org/mozilla-central/rev/d44d0b5590b7
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
You need to log in before you can comment on or make changes to this bug.