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

Crash in [@ java.lang.RuntimeException: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java)] #14852

Closed
kbrosnan opened this issue Sep 8, 2020 · 12 comments
Assignees
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info Feature:Download

Comments

@kbrosnan
Copy link
Contributor

kbrosnan commented Sep 8, 2020

Similar to #6436

Crash report: https://crash-stats.mozilla.org/report/index/394f182b-8987-4fa1-b8b6-8190a0200908
Sentry: https://sentry.prod.mozaws.net/operations/firefox-nightly/issues/9509776/?query=is%3Aunresolved (looks like started Sept 1)

Java stack trace:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:504)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
	... 1 more
Caused by: mozilla.components.lib.state.StoreException: Exception while reducing state
	at mozilla.components.lib.state.Store$$special$$inlined$CoroutineExceptionHandler$1$lambda$1.run(Store.kt:1)
	at android.os.Handler.handleCallback(Handler.java:873)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7073)
	... 3 more
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=org.mozilla.firefox_beta/org.mozilla.fenix.downloads.DownloadService (has extras) }: app is in background uid UidRecord{ba745a5 u0a1159 CEM  idle change:cached procs:1 proclist:17880, seq(0,0,0)}
	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1666)
	at android.app.ContextImpl.startService(ContextImpl.java:1611)
	at android.content.ContextWrapper.startService(ContextWrapper.java:677)
	at mozilla.components.feature.downloads.DownloadMiddleware.sendDownloadIntent(DownloadMiddleware.kt:4)
	at mozilla.components.feature.downloads.DownloadMiddleware.invoke(DownloadMiddleware.kt:17)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.media.middleware.MediaMiddleware.invoke(MediaMiddleware.kt:39)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$threadCheck$1.invoke(ReducerChainBuilder.kt:4)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.lib.state.Store$dispatch$1.invokeSuspend(Store.kt:4)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:3)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:21)
	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)

┆Issue is synchronized with this Jira Task

@kbrosnan kbrosnan added b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info Feature:Download labels Sep 8, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Sep 8, 2020
@liuche
Copy link
Contributor

liuche commented Sep 8, 2020

Looks Downloads related, @Amejia481 or @kglazko could you coordinate/take a look? If this is in Nightly, it may be in Beta too so if it's a problem we'll want to uplift this fix.

@liuche liuche removed the needs:triage Issue needs triage label Sep 8, 2020
@Amejia481
Copy link
Contributor

I will take a look

@Amejia481 Amejia481 self-assigned this Sep 8, 2020
@kbrosnan
Copy link
Contributor Author

kbrosnan commented Sep 8, 2020

This is the top crash in Beta so yes this needs an 81 fix.

@Amejia481
Copy link
Contributor

This will be addressed when mozilla-mobile/android-components#8364 lands and Fenix picks the new ac version.

@dholbert
Copy link
Contributor

I'm hitting this reliably several times per day, FWIW; I'll glance at my phone and notice a notification telling me "Sorry, Firefox Nightly had a problem and crashed". Logcat shows "ActivityManager: Background start not allowed: service Intent { cmp=org.mozilla.fenix/.downloads.DownloadService (has extras) } to org.mozilla.fenix/.downloads.DownloadService" which is what brought me to this issue here.

Looks like the Play Store has a update for Nightly available for me right now. Not sure if it has the fix mentioned above yet (I'm guessing yes since it was merged 23 hours ago). In any case, I can report back regarding whether this seems fixed or not.

@sv-ohorvath
Copy link
Contributor

@Amejia481 @liuche is this supposed to be uplifted to 81.1.1.beta3 now? If so, do we have any STR for QA? Thanks!

@Amejia481
Copy link
Contributor

@sv-ohorvath I think it's already uplifted, for the steps to reproduce @dholbert could help us as he was hitting issue. I wasn't able to replicate it on my own.

@sv-ohorvath
Copy link
Contributor

sv-ohorvath commented Sep 11, 2020

I see this notification on Beta, I don't have STR, I just noticed it there, may it be something related?:
Screenshot_20200911-172219

@Amejia481
Copy link
Contributor

I think this is another issue #14970. I'm not aware of the exact STR, but I think it was related to restarting the downloads. Some steps close to the STR could be downloading a file and completing the download, then kill the app and restart. There I think it was when the app was crashing, we could try with the devices where the crash was more prevalent, Android 9 and 10 you can see the specific brands and models here.

@Amejia481
Copy link
Contributor

Another thing that can give us a hint, if the issue was fixed, it's the patch that fixed the issue was introduced on ac 58.0.20200910190642 (2020-09-10). So far I haven't seen any occurrence on sentry for that ac version or above.

@dholbert
Copy link
Contributor

dholbert commented Sep 11, 2020

I haven't hit the crash since my comment yesterday (when I installed the Nightly update that had the hypothetical fix). Previously I was seeing this several times per day, so I'd call this confirmation that this is indeed fixed.

(Regarding the STR: I think it was something like: (0) have some broken downloads from e.g. #14434; (1) start fenix (2) switch apps (3) wait for a little while (~minutes, I think?) Then at some point, a crash notification would appear in my system tray.)

@sv-ohorvath
Copy link
Contributor

We didn't encounter this while testing this beta build either, so I'll close this issue. Thanks @dholbert for confirming!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info Feature:Download
Projects
None yet
Development

No branches or pull requests

5 participants