Closed Bug 1264134 Opened 4 years ago Closed 4 years ago

Crash on startup with new profile – IllegalThreadStateException


(Firefox for Android :: General, defect)

Not set



Firefox 48
Tracking Status
firefox48 --- verified
fennec 48+ ---


(Reporter: mcomella, Assigned: ahunt)




(2 files)

Attached file Full stack trace
04-12 17:04:55.151 E/GeckoCrashHandler( 7469): java.lang.IllegalThreadStateException: Expected anything but 1 ("main"), but running there.
04-12 17:04:55.151 E/GeckoCrashHandler( 7469):  at org.mozilla.gecko.reader.SavedReaderViewHelper.loadItems(
04-12 17:04:55.151 E/GeckoCrashHandler( 7469):  at org.mozilla.gecko.db.BrowserDatabaseHelper.onOpen(
04-12 17:04:55.151 E/GeckoCrashHandler( 7469):  at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(
04-12 17:04:55.151 E/GeckoCrashHandler( 7469):  at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(

This seems like it may be related to the bookmarks in reading list changes. Andrzej?
Flags: needinfo?(ahunt)
Notably, I had an sync account enabled when I started fennec.
It turns out that with sync enabled, we do the first load of the database on the UI thread.
The SavedReaderViewHelper (which is initialised during DB load) assumes we're run off the
main thread, we need to disable that assertion until we can ensure that DB loading is done
off the main thread.

Review commit:
See other reviews:
Attachment #8740735 - Flags: review?(michael.l.comella)
Duplicate of this bug: 1264263
Comment on attachment 8740735 [details]
MozReview Request: Bug 1264134 - Don't assert SavedReaderViewHelper running off main thread r?mcomella

Discussed IRL, we're going to come up with the real fix but this is just to stop nightly from crashing.

::: mobile/android/base/java/org/mozilla/gecko/reader/
(Diff revision 1)
>       * Load the reader view cache list from our JSON file.
>       *
>       * Must not be run on the UI thread due to file access.
>       */
>      public synchronized void loadItems() {
> -        ThreadUtils.assertNotOnUiThread();
> +        // Band aid fix for Bug 1264134. We need to figure out the root cause and reenable this

nit: Add a `//TODO bug #` so we know this is going to get fixed.
Attachment #8740735 - Flags: review?(michael.l.comella) → review+
Bug 1264134 - Don't assert SavedReaderViewHelper running off main thread r=mcomella
I've created Bug 1264489 to find the real cause.
Flags: needinfo?(ahunt)
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Assignee: nobody → ahunt
tracking-fennec: ? → 48+
Verified as fixed in Nightly 48.0a1 (2016-04-21);
Device: Asus ZenPad 8 (Android 5.0.2);
You need to log in before you can comment on or make changes to this bug.