Closed Bug 1264134 Opened 8 years ago Closed 8 years ago

Crash on startup with new profile – IllegalThreadStateException

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(firefox48 verified, fennec48+)

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

People

(Reporter: mcomella, Assigned: ahunt)

References

Details

Attachments

(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(SavedReaderViewHelper.java:92)
04-12 17:04:55.151 E/GeckoCrashHandler( 7469):  at org.mozilla.gecko.db.BrowserDatabaseHelper.onOpen(BrowserDatabaseHelper.java:1456)
04-12 17:04:55.151 E/GeckoCrashHandler( 7469):  at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:266)
04-12 17:04:55.151 E/GeckoCrashHandler( 7469):  at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)

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: https://reviewboard.mozilla.org/r/45973/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45973/
Attachment #8740735 - Flags: review?(michael.l.comella)
Comment on attachment 8740735 [details]
MozReview Request: Bug 1264134 - Don't assert SavedReaderViewHelper running off main thread r?mcomella

https://reviewboard.mozilla.org/r/45973/#review42607

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/SavedReaderViewHelper.java:92
(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+
https://hg.mozilla.org/integration/fx-team/rev/925b730233c2688aeb6ccdf474f3a54f01abfa65
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)
https://hg.mozilla.org/mozilla-central/rev/925b730233c2
Status: NEW → RESOLVED
Closed: 8 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);
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.