Crash shortly after startup, about:home not filled in

VERIFIED FIXED in Firefox 14

Status

()

Firefox for Android
General
--
critical
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: Martijn Wargers (dead), Assigned: lucasr)

Tracking

({crash})

Trunk
Firefox 15
ARM
Android
crash
Points:
---

Firefox Tracking Flags

(firefox14 fixed, firefox15 fixed, blocking-fennec1.0 +)

Details

(Whiteboard: [native-crash],)

Attachments

(4 attachments)

(Reporter)

Description

5 years ago
Created attachment 620118 [details]
logcat

On the Samsung galaxy Nexus, I'm currently crashing with current Native trunk build, shortly after startup.
About:home is not filled in and soon after, Fennec crashes.

I got in this state after a previous crash, if I remember correctly.

I guess this is the relevant part of logcat:
05-02 01:02:18.317 E/SQLiteDatabase(30052): close() was never explicitly called on database '/data/data/org.mozilla.fennec/files/mozilla/wzho9h6h.default/browser.db' 
05-02 01:02:18.317 E/SQLiteDatabase(30052): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1943)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1007)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1051)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:770)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.db.DBUtils.ensureDatabaseIsNotLocked(DBUtils.java:76)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.fennec.db.BrowserProvider.getDatabaseHelperForProfile(BrowserProvider.java:977)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.fennec.db.BrowserProvider.getReadableDatabase(BrowserProvider.java:1016)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.fennec.db.BrowserProvider.query(BrowserProvider.java:1538)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.content.ContentResolver.query(ContentResolver.java:311)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.db.LocalBrowserDB.filterAllSites(LocalBrowserDB.java:173)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.db.LocalBrowserDB.getTopSites(LocalBrowserDB.java:195)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.db.BrowserDB.getTopSites(BrowserDB.java:119)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.AboutHomeContent.loadTopSites(AboutHomeContent.java:346)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.AboutHomeContent.access$400(AboutHomeContent.java:95)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.AboutHomeContent$9.run(AboutHomeContent.java:375)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.os.Handler.handleCallback(Handler.java:605)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.os.Handler.dispatchMessage(Handler.java:92)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at android.os.Looper.loop(Looper.java:137)
05-02 01:02:18.317 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31)
05-02 01:02:18.325 E/SQLiteDatabase(30052): close() was never explicitly called on database '/data/data/org.mozilla.fennec/files/mozilla/wzho9h6h.default/browser.db' 
05-02 01:02:18.325 E/SQLiteDatabase(30052): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1943)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1007)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1051)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:770)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.db.DBUtils.ensureDatabaseIsNotLocked(DBUtils.java:85)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.fennec.db.BrowserProvider.getDatabaseHelperForProfile(BrowserProvider.java:977)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.fennec.db.BrowserProvider.getReadableDatabase(BrowserProvider.java:1016)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.fennec.db.BrowserProvider.query(BrowserProvider.java:1538)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.content.ContentResolver.query(ContentResolver.java:311)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.db.LocalBrowserDB.filterAllSites(LocalBrowserDB.java:173)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.db.LocalBrowserDB.getTopSites(LocalBrowserDB.java:195)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.db.BrowserDB.getTopSites(BrowserDB.java:119)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.AboutHomeContent.loadTopSites(AboutHomeContent.java:346)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.AboutHomeContent.access$400(AboutHomeContent.java:95)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.AboutHomeContent$9.run(AboutHomeContent.java:375)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.os.Handler.handleCallback(Handler.java:605)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.os.Handler.dispatchMessage(Handler.java:92)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at android.os.Looper.loop(Looper.java:137)
05-02 01:02:18.325 E/SQLiteDatabase(30052): 	at org.mozilla.gecko.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31)
(Reporter)

Comment 1

5 years ago
A reboot of the phone seems to have fixed it.
So I guess it's some kind of database locking issue or something?
(Reporter)

Comment 2

5 years ago
Ok, I'm in this state again, after some hang/crash from Fennec.

(I got into this hang/crash state after visiting this page: http://www.telegraaf.nl/binnenland/12040352/__Juwelierkillers_gevlucht_naar_Belgi__.html and playing the Flash video there).
Assignee: nobody → lucasr.at.mozilla
blocking-fennec1.0: ? → +
(Assignee)

Comment 3

5 years ago
Ok, logcat shows that my patch is not fixing the locking issue, at least for this device. We'll have to investigate this issue a bit more.
(Assignee)

Updated

5 years ago
Duplicate of this bug: 750739
(Assignee)

Comment 5

5 years ago
Martijn, could you please run "adb shell ps" and post the output here when the DB locking happens again?
(Reporter)

Comment 6

5 years ago
Created attachment 621538 [details]
adb shell ps when this happens

Ok, I'm currently again in this state, after Fennec hung (this is with a testcase, I'm still working on, although it should crash, not han).
(Reporter)

Comment 7

5 years ago
Created attachment 621539 [details]
adb shell ps after Fennec crashed

This is 'adb shell ps' after Fennec has closed because of this bug.
I see it still in the list of processes.
(Assignee)

Comment 8

5 years ago
Ok, my suspicion was correct (this is why I asked for the list of processes). What is actually happening is that there's a zombie Fennec process holding the database lock. Need to figure out a way to ensure that we cleanly exit all Fennec processes before re-starting the app after an update or crash.
(Assignee)

Comment 9

5 years ago
I created a build that kills any zombie processes when the providers are created. My current theory is that zombie processes are holding the mysterious database lock when we crash. Here's the apk:

http://dl.dropbox.com/u/1187037/kill-zombies-fennec.apk

Martijn, could you please try to reproduce the bug using this build?
(Reporter)

Comment 10

5 years ago
Unfortunately, Fennec isn't in this state, currently on my device and I'm not sure how to get into this state.
(Reporter)

Comment 11

5 years ago
I've tried it now quite some time to get into this state, but I'm unable to :/
(Assignee)

Comment 12

5 years ago
Created attachment 622749 [details] [diff] [review]
Kill any zombie processes if database is locked
Attachment #622749 - Flags: review?(blassey.bugs)
(Assignee)

Comment 13

5 years ago
This APK has this patch applied. It will log a message with a "GeckoDBUtils" prefix when the locking issue happens and we try to auto-fix it:

  http://dl.dropbox.com/u/1187037/kill-zombies-fennec.apk

It would be nice if QA could try very hard to reproduce the locking issue using this APK. If you see GeckoDBUtils in logcat and Fennec continues to work fine, this means that the patch actually fixes the problem.
Attachment #622749 - Flags: review?(blassey.bugs) → review+
(Assignee)

Comment 14

5 years ago
Pushed: http://hg.mozilla.org/integration/mozilla-inbound/rev/b7fb17a9702f
https://hg.mozilla.org/mozilla-central/rev/b7fb17a9702f
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 15
(Reporter)

Comment 16

5 years ago
I had a build before this fix that had this crash on startup.
I then installed a build from http://nightly.mozilla.org , from after this fix went in.
For some reason, it still closed shortly after startup the first time, but when I started up the second time, it worked fine (although I didn't see 'Your tabs from last time').

That's the closest I can get to verifying this bug.

I had sort of a way of reproducing this, but it involved complicated steps that I had to take and most of the times I would just crash. When I try to reproduce it that way now, I always seem to crash directly.
Lucas - Can you a? and provide a risk assessment for uplifting to aurora
Attachment #622749 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/7ced703e9e52
status-firefox14: --- → fixed
status-firefox15: --- → fixed

Updated

5 years ago
Duplicate of this bug: 752907
(Reporter)

Comment 20

5 years ago
Ok, now I'm pretty certain this is fixed.
I again got into this situation.
So with this patch, I get a crash shortly after startup the first time, then upon a restart, Fennec is working again and I don't have any tabs from last time.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.