Closed Bug 722055 Opened 8 years ago Closed 8 years ago

Crash on startup -- SQLiteDatabaseLockedException: error code 5: database is locked

Categories

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

ARM
Android
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox15 --- affected
blocking-fennec1.0 --- +

People

(Reporter: aaronmt, Unassigned)

Details

(Keywords: crash, Whiteboard: [native-crash], strwanted)

Attachments

(4 files)

Attached file Nightly (01/28)
E/SQLiteOpenHelper( 7851): Couldn't open /data/data/org.mozilla.fennec/files/mozilla/6dqu9x5n.default/browser.db for writing (will try read-only):
E/SQLiteOpenHelper( 7851): android.database.sqlite.SQLiteDatabaseLockedException: error code 5: database is locked
E/SQLiteOpenHelper( 7851): 	at android.database.sqlite.SQLiteStatement.native_1x1_string(Native Method)
E/SQLiteOpenHelper( 7851): 	at android.database.sqlite.SQLiteStatement.simpleQueryForString(SQLiteStatement.java:161)
E/SQLiteOpenHelper( 7851): 	at android.database.DatabaseUtils.stringForQuery(DatabaseUtils.java:735)
E/SQLiteOpenHelper( 7851): 	at android.database.DatabaseUtils.stringForQuery(DatabaseUtils.java:723)
E/SQLiteOpenHelper( 7851): 	at android.database.sqlite.SQLiteDatabase.setJournalMode(SQLiteDatabase.java:1060)
E/SQLiteOpenHelper( 7851): 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:996)
E/SQLiteOpenHelper( 7851): 	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1051)
E/SQLiteOpenHelper( 7851): 	at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:770)
E/SQLiteOpenHelper( 7851): 	at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
E/SQLiteOpenHelper( 7851): 	at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
E/SQLiteOpenHelper( 7851): 	at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:231)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.fennec.db.BrowserProvider.getReadableDatabase(BrowserProvider.java:513)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.fennec.db.BrowserProvider.query(BrowserProvider.java:917)
E/SQLiteOpenHelper( 7851): 	at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
E/SQLiteOpenHelper( 7851): 	at android.content.ContentResolver.query(ContentResolver.java:310)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.gecko.db.LocalBrowserDB.filterAllSites(LocalBrowserDB.java:84)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.gecko.db.LocalBrowserDB.getTopSites(LocalBrowserDB.java:111)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.gecko.db.BrowserDB.getTopSites(BrowserDB.java:103)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.gecko.AboutHomeContent.loadTopSites(AboutHomeContent.java:267)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.gecko.AboutHomeContent.access$300(AboutHomeContent.java:92)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.gecko.AboutHomeContent$6.run(AboutHomeContent.java:297)
E/SQLiteOpenHelper( 7851): 	at android.os.Handler.handleCallback(Handler.java:605)
E/SQLiteOpenHelper( 7851): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/SQLiteOpenHelper( 7851): 	at android.os.Looper.loop(Looper.java:137)
E/SQLiteOpenHelper( 7851): 	at org.mozilla.gecko.GeckoAppShell$LooperThread.run(GeckoAppShell.java:185)



E/SQLiteDatabase( 7851): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
E/SQLiteDatabase( 7851): 	at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1943)
E/SQLiteDatabase( 7851): 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1007)
E/SQLiteDatabase( 7851): 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
E/SQLiteDatabase( 7851): 	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1051)
E/SQLiteDatabase( 7851): 	at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:770)
E/SQLiteDatabase( 7851): 	at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
E/SQLiteDatabase( 7851): 	at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
E/SQLiteDatabase( 7851): 	at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:231)
E/SQLiteDatabase( 7851): 	at org.mozilla.fennec.db.BrowserProvider.getReadableDatabase(BrowserProvider.java:513)
E/SQLiteDatabase( 7851): 	at org.mozilla.fennec.db.BrowserProvider.query(BrowserProvider.java:917)
E/SQLiteDatabase( 7851): 	at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
E/SQLiteDatabase( 7851): 	at android.content.ContentResolver.query(ContentResolver.java:310)
E/SQLiteDatabase( 7851): 	at org.mozilla.gecko.db.LocalBrowserDB.filterAllSites(LocalBrowserDB.java:84)
E/SQLiteDatabase( 7851): 	at org.mozilla.gecko.db.LocalBrowserDB.getTopSites(LocalBrowserDB.java:111)
E/SQLiteDatabase( 7851): 	at org.mozilla.gecko.db.BrowserDB.getTopSites(BrowserDB.java:103)
E/SQLiteDatabase( 7851): 	at org.mozilla.gecko.AboutHomeContent.loadTopSites(AboutHomeContent.java:267)
E/SQLiteDatabase( 7851): 	at org.mozilla.gecko.AboutHomeContent.access$300(AboutHomeContent.java:92)
E/SQLiteDatabase( 7851): 	at org.mozilla.gecko.AboutHomeContent$6.run(AboutHomeContent.java:297)
E/SQLiteDatabase( 7851): 	at android.os.Handler.handleCallback(Handler.java:605)
E/SQLiteDatabase( 7851): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/SQLiteDatabase( 7851): 	at android.os.Looper.loop(Looper.java:137)
E/SQLiteDatabase( 7851): 	at org.mozilla.gecko.GeckoAppShell$LooperThread.run(GeckoAppShell.java:185)


I/SqliteDatabaseCpp( 7851): sqlite returned: error code = 5, msg = statement aborts at 1: [PRAGMA journal_mode=TRUNCATE] , db=/data/data/org.mozilla.fennec/files/mozilla/6dqu9x5n.default/browser.db
W/dalvikvm( 7851): threadid=14: thread exiting with uncaught exception (group=0x40a5e1f8)
E/AndroidRuntime( 7851): FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime( 7851): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime( 7851): 	at android.os.AsyncTask$3.done(AsyncTask.java:278)
E/AndroidRuntime( 7851): 	at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
E/AndroidRuntime( 7851): 	at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
E/AndroidRuntime( 7851): 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
E/AndroidRuntime( 7851): 	at java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/AndroidRuntime( 7851): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
E/AndroidRuntime( 7851): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
E/AndroidRuntime( 7851): 	at java.lang.Thread.run(Thread.java:856)
E/AndroidRuntime( 7851): Caused by: android.database.sqlite.SQLiteDatabaseLockedException: error code 5: database is locked
E/AndroidRuntime( 7851): 	at android.database.sqlite.SQLiteStatement.native_1x1_string(Native Method)
E/AndroidRuntime( 7851): 	at android.database.sqlite.SQLiteStatement.simpleQueryForString(SQLiteStatement.java:161)
E/AndroidRuntime( 7851): 	at android.database.DatabaseUtils.stringForQuery(DatabaseUtils.java:735)
E/AndroidRuntime( 7851): 	at android.database.DatabaseUtils.stringForQuery(DatabaseUtils.java:723)
E/AndroidRuntime( 7851): 	at android.database.sqlite.SQLiteDatabase.setJournalMode(SQLiteDatabase.java:1060)
E/AndroidRuntime( 7851): 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:996)
E/AndroidRuntime( 7851): 	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1051)
E/AndroidRuntime( 7851): 	at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:770)
E/AndroidRuntime( 7851): 	at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
E/AndroidRuntime( 7851): 	at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
E/AndroidRuntime( 7851): 	at org.mozilla.fennec.db.BrowserProvider.getWritableDatabase(BrowserProvider.java:524)
E/AndroidRuntime( 7851): 	at org.mozilla.fennec.db.BrowserProvider.update(BrowserProvider.java:836)
E/AndroidRuntime( 7851): 	at android.content.ContentProvider$Transport.update(ContentProvider.java:219)
E/AndroidRuntime( 7851): 	at android.content.ContentResolver.update(ContentResolver.java:855)
E/AndroidRuntime( 7851): 	at org.mozilla.gecko.db.LocalBrowserDB.updateFaviconForUrl(LocalBrowserDB.java:383)
E/AndroidRuntime( 7851): 	at org.mozilla.gecko.db.BrowserDB.updateFaviconForUrl(BrowserDB.java:156)
E/AndroidRuntime( 7851): 	at org.mozilla.gecko.Favicons$LoadFaviconTask.saveFaviconToDb(Favicons.java:261)
E/AndroidRuntime( 7851): 	at org.mozilla.gecko.Favicons$LoadFaviconTask.downloadFavicon(Favicons.java:312)
E/AndroidRuntime( 7851): 	at org.mozilla.gecko.Favicons$LoadFaviconTask.doInBackground(Favicons.java:368)
E/AndroidRuntime( 7851): 	at org.mozilla.gecko.Favicons$LoadFaviconTask.doInBackground(Favicons.java:225)
E/AndroidRuntime( 7851): 	at android.os.AsyncTask$2.call(AsyncTask.java:264)
E/AndroidRuntime( 7851): 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/AndroidRuntime( 7851): 	... 4 more

--
Samsung Galaxy Nexus (Android 4.0.3)
Mozilla/5.0 (Android; Linux armv7l; rv:12.0a1) Gecko/20120128 Firefox/12.0a1 Fennec/12.0a1
No idea what the heck happened but I cant reproduce this launching Fennec again.
Whiteboard: [native-crash] → [native-crash], strwanted
Actually scratch that, Fennec is reproducing this on every launch now.
tracking-fennec: --- → ?
Gian, maybe this is triggered by the changes you've made in our SQLite stuff? This wasn't happening before...
>Samsung Galaxy Nexus (Android 4.0.3)

My code is conditional on !Build.VERSION.SDK_INT >= 11

https://hg.mozilla.org/mozilla-central/rev/e7142decacd5

and we use 

http://hg.mozilla.org/mozilla-central/file/bfeeb813aef2/mobile/android/config/mozconfigs/android/nightly

so it shouldn't be active here.
Assignee: nobody → gpascutto
tracking-fennec: ? → 11+
Priority: -- → P1
Reproduced again on Nightly (02/01) 13.0a1.

Galaxy Nexus (Android 4.0.2)
blocking-fennec1.0: --- → beta+
Status: NEW → ASSIGNED
aaron need str.  gcp hasn't seen it.  please reopen if you see this again.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Just ran into this today after testing bug 749606
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
tracking-fennec: 11+ → ---
blocking-fennec1.0: beta+ → ?
Assignee: gpascutto → nobody
Aaron, I've already filed bug 749493 to track this. Testing with the attached patch (or latest inbound) would be helpful. You can keep this one closed.
Marking works for me again then.
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → WORKSFORME
blocking-fennec1.0: ? → +
You need to log in before you can comment on or make changes to this bug.