Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] Crash on every startup #19232

Closed
klint opened this issue Apr 25, 2021 · 17 comments
Closed

[Bug] Crash on every startup #19232

klint opened this issue Apr 25, 2021 · 17 comments
Labels
🐞 bug Crashes, Something isn't working, .. eng:qa:verified QA Verified
Milestone

Comments

@klint
Copy link

klint commented Apr 25, 2021

Firefox nightly suddenly started to crash at every restart (not right after last update yesterday, but for a couple of hours).

android.database.sqIite.SQLiteBIobTooBigException: Row too big to fit into CursorWindow
requiredPos=0, totalRows=75
at
android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
at
android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:859)
at
android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)
at
android.database.sqIite.SQLiteQuery.fiIIWindow(SQLiteQuery.java:62)
at
android.database.sqIite.SQLiteCursor.fiIIWindow(SQLiteCursor.java:151)
at
android.database.sqIite.SQLiteCursor.getCount(SQLiteCursor.java:139)
at
mozilla.components.feature.downloads.db.DownloadDao_lmpl$10.call(DownloadDao_lmpl.java:10)
at
androidx.room.CoroutinesRoom$Companion$execute$2.invokeSuspend(CoroutinesRoom.kt:2)
at
kotlin.coroutines.jvm.intemal.BaseContinuationlmpl.resumtWith(Continuationlmpl.kt:3)
at
kotlinx.coroutines.DispatchedTask. run(DispatchedTask.kt:15)
at
java. util. concurrent. ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1167)
at
java. util. concurrent. ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

Device information

Redmi Note 7 with latest nightly build (210424 17:00).
MIUI 11 Android 9

┆Issue is synchronized with this Jira Task

@klint klint added the 🐞 bug Crashes, Something isn't working, .. label Apr 25, 2021
@github-actions github-actions bot added the needs:triage Issue needs triage label Apr 25, 2021
@kbrosnan
Copy link
Contributor

Duplicate #19223

@pocmo
Copy link
Contributor

pocmo commented Apr 26, 2021

@kbrosnan The stacktrace looks different though! 🤔

@kbrosnan kbrosnan reopened this Apr 26, 2021
@klint
Copy link
Author

klint commented Apr 26, 2021

Thanks for reopening.
I must add some context, which may be important: the crash started not long after I installed an addon which is not yet validated, as far as I know. I cannot recall the name as my Firefox still crashes, but it was about taking a snapshot of a webpage. I played with it without a problem for a while, then Firefox started to crash.

@Amejia481
Copy link
Contributor

@klint if it's not much trouble, could you share the logcat logs ? You can find instructions of how to get them here.

@Amejia481
Copy link
Contributor

I'm no able to find any reports on sentry (on any Firefox variants). @klint did you remember the last file or url that you download? If you had a Firefox account on nightly you can see your history on desktop.

@Amejia481
Copy link
Contributor

We are only storing metadata about downloads when a file is downloaded into a room db, and we restore the metadata on startup:

The only that I can think that can grow that big it's the URL of a downloaded file:
https://github.com/mozilla-mobile/android-components/blob/feb080f1208d65767f492f8501a4648a9f488b86/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/db/DownloadEntity.kt#L16

@klint
Copy link
Author

klint commented Apr 26, 2021

I'm sorry I don't have access to a computer where I could install the drivers to get the logacg logs..
What I remember is that the app was fine until I closed it and tried to reopen it, I think. That could fit with your scenario.
Just before that, I had generated and downloaded a screenshot from this web page, using the screenshot add-on : https://wid.world/news-article/2020-regional-updates/

@Amejia481
Copy link
Contributor

We are only storing metadata about downloads when a file is downloaded into a room db, and we restore the metadata on startup:

The only that I can think that can grow that big it's the URL of a downloaded file:
https://github.com/mozilla-mobile/android-components/blob/feb080f1208d65767f492f8501a4648a9f488b86/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/db/DownloadEntity.kt#L16

When I inspect the download table I found that the add-on provided us with a data URL, and this is what is causing the crash that you are experiencing, the string stored in the download table is to big for your device to handle it when we restore the metadata on startup.

image

@Amejia481
Copy link
Contributor

I opened a bug that will prevent that from happening in the feature mozilla-mobile/android-components#10157. Unfortunately you will have to clear your app data as a workaround to avoid the crash You can find some steps here.

@klint
Copy link
Author

klint commented Apr 26, 2021

Thank you for your help and analysis! At least, that will be a good reason for me to give up with collections in Fenix for good. I have lost all of them. Silly me, as I knew they were not synced in any manner. Why do they exist actually? But that is a another story, and another issue!
Cheers

@klint
Copy link
Author

klint commented Apr 26, 2021

One last question though... instead of/in addition to not storing data Urls, why not catching the error at startup rather than letting the app crash? That would save my collections 😊

@Amejia481
Copy link
Contributor

Thank you for your help and analysis! At least, that will be a good reason for me to give up with collections in Fenix for good. I have lost all of them. Silly me, as I knew they were not synced in any manner. Why do they exist actually? But that is a another story, and another issue!
Cheers

The idea with collection is to give developers an opportunity to test their extensions on Fenix you can read more on this blog post :)

One last question though... instead of/in addition to not storing data Urls, why not catching the error at startup rather than letting the app crash? That would save my collections 😊

When we store a download metadata with data URLs into the db, we can't load it back to memory this is the exception that you are experiencing, even if we catch the exception we are not going to be able to show the download information in the download screen, as we can load it to memory.

@klint
Copy link
Author

klint commented Apr 27, 2021

The idea with collection is to give developers an opportunity to test their extensions on Fenix you can read more on this blog post :)

Sorry for the confusion, I was talking about the collections of sites that are displayed on the home page of Fenix. Add-on collections are quite useful indeed, but I don't see the point for the site collections as they are now (especially as they are not synced).

When we store a download metadata with data URLs into the db, we can't load it back to memory this is the exception that you are experiencing, even if we catch the exception we are not going to be able to show the download information in the download screen, as we can load it to memory.

I was just hoping that by catching the error, I would be able to get my site collections back in a further nightly build (using Fenix beta in the meantime) ;).

@Amejia481
Copy link
Contributor

Sorry for the confusion, I'm not that familiar with site collections but I know for sure that somebody on the team can help you to clarify on Matrix: https://chat.mozilla.org/#/room/#fenix:mozilla.org, that it's our public channel.

@Amejia481
Copy link
Contributor

Some notes for QA to verify that the issue is fixed.

STR:

  1. Download this file.
  2. Kill nightly.
  3. Open nightly and go to the download page.

The downloaded file should be visible in the download page without any crash.

@Amejia481 Amejia481 added the eng:qa:needed QA Needed label May 4, 2021
@Amejia481 Amejia481 added this to the 90 milestone May 4, 2021
@sflorean
Copy link
Contributor

sflorean commented May 7, 2021

Followed the steps provided and didn't encounter any crash on Nightly 5/7.

@sflorean sflorean closed this as completed May 7, 2021
@sflorean sflorean added eng:qa:verified QA Verified and removed eng:qa:needed QA Needed labels May 7, 2021
@gabrielluong gabrielluong removed the needs:triage Issue needs triage label May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. eng:qa:verified QA Verified
Projects
None yet
Development

No branches or pull requests

6 participants