Closed Bug 850645 Opened 13 years ago Closed 13 years ago

Unable to launch WebApps - Crash @ java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/data/org.mozilla.fennec/files/mozilla/webapp/browser.db

Categories

(Firefox for Android Graveyard :: Data Providers, defect)

ARM
Android
defect
Not set
critical

Tracking

(firefox19 unaffected, firefox20 unaffected, firefox21 unaffected, firefox22 affected)

RESOLVED DUPLICATE of bug 844895
Tracking Status
firefox19 --- unaffected
firefox20 --- unaffected
firefox21 --- unaffected
firefox22 --- affected

People

(Reporter: aaronmt, Unassigned)

Details

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

Attachments

(1 file, 1 obsolete file)

D/GeckoDBUtils( 6057): Database is locked, trying to kill any zombie processes: /data/data/org.mozilla.fennec/files/mozilla/ki37kaux.webapp0/browser.db I/Process ( 6057): Sending signal. PID: 6116 SIG: 9 I/Process ( 6057): Sending signal. PID: 6125 SIG: 9 I/Process ( 6057): Sending signal. PID: 6256 SIG: 9 W/dalvikvm( 6057): threadid=10: thread exiting with uncaught exception (group=0x40c63930) E/GeckoAppShell( 6057): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 365 ("GeckoBackgroundThread") E/GeckoAppShell( 6057): java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/data/org.mozilla.fennec/files/mozilla/ki37kaux.webapp0/browser.db E/GeckoAppShell( 6057): at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55) E/GeckoAppShell( 6057): at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1534) E/GeckoAppShell( 6057): at android.database.sqlite.SQLiteDatabase.update(SQLiteDatabase.java:1514) E/GeckoAppShell( 6057): at org.mozilla.fennec.db.BrowserProvider.updateFaviconIdsForUrl(BrowserProvider.java:2911) E/GeckoAppShell( 6057): at org.mozilla.fennec.db.BrowserProvider.insertFavicon(BrowserProvider.java:2945) E/GeckoAppShell( 6057): at org.mozilla.fennec.db.BrowserProvider$DatabaseHelper.createFavicon(BrowserProvider.java:1118) E/GeckoAppShell( 6057): at org.mozilla.fennec.db.BrowserProvider$DatabaseHelper.access$100(BrowserProvider.java:375) E/GeckoAppShell( 6057): at org.mozilla.fennec.db.BrowserProvider$DatabaseHelper$2.run(BrowserProvider.java:1083) E/GeckoAppShell( 6057): at android.os.Handler.handleCallback(Handler.java:725) E/GeckoAppShell( 6057): at android.os.Handler.dispatchMessage(Handler.java:92) E/GeckoAppShell( 6057): at android.os.Looper.loop(Looper.java:137) E/GeckoAppShell( 6057): at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:32) E/Gecko ( 6057): mozalloc_abort: Redirecting call to abort() to mozalloc_abort i) Install Twitter from Firefox Marketplace ii) Launch Twitter from the Android
Severity: normal → critical
Attached file Raw logcat
Summary: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/data/org.mozilla.fennec/files/mozilla/webapp/browser.db → Unable to launch WebApps - Crash @ java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/data/org.mozilla.fennec/files/mozilla/webapp/browser.db
Launching an installed WebApp with fennec fully forced-stopped works
Wes - Any ideas?
Flags: needinfo?(wjohnston)
Last working good build on m-c 20130307030926 http://hg.mozilla.org/mozilla-central/rev/ee4879719f78 Unfortunately bug 849539 from builds afterwards is obscuring attempts to narrow this
First known bad build on m-c that has lets you get further in web-app startup with bug 849539 20130312031046 http://hg.mozilla.org/mozilla-central/rev/7433bc4545c9 Kind of big, anything stick out? http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ee4879719f78&tochange=7433bc4545c9
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(wjohnston)
Attached patch Patch (obsolete) — Splinter Review
I think the problem here is that SqliteDBConnection implements its own ref counting. When the db moves out of scope in the first thread, we move its refcount to zero. When the background thread tries to use the safe db reference to create favicons, it fails here: http://androidxref.com/4.2.2_r1/xref/frameworks/base/core/java/android/database/sqlite/SQLiteClosable.java#52 This just forces us to acquire a fresh db reference in the favicon creation code. Alternatively, we could play with calling acquireReference ourselves as an alternative.
Attachment #727296 - Flags: review?(lucasr.at.mozilla)
This bug is closed. The patch should be attach to bug 844895.
Comment on attachment 727296 [details] [diff] [review] Patch Review of attachment 727296 [details] [diff] [review]: ----------------------------------------------------------------- Not on your patch but spawning db writing tasks on a separate thread from onCreate() looks rather risky... Anyway, looks good. I just wonder if there's a chance that the SQLiteOpenHelper is disposed before the background task runs (which could cause a crash on this new getWritableDatabase() call).
Attachment #727296 - Flags: review?(lucasr.at.mozilla) → review+
Attachment #727296 - Attachment is obsolete: true
tracking-fennec: ? → ---
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: