Closed Bug 1720840 Opened 3 years ago Closed 3 years ago

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

Categories

(Fenix :: General, defect)

defect

Tracking

(firefox92blocking disabled, firefox93+ fixed, firefox94 fixed)

RESOLVED MOVED
Tracking Status
firefox92 blocking disabled
firefox93 + fixed
firefox94 --- fixed

People

(Reporter: emilio, Unassigned)

References

Details

(Keywords: crash)

Crash Data

Crash report: https://crash-stats.mozilla.org/report/index/832283d2-4e55-48ad-81a9-eb5dd0210716

Java stack trace:

java.lang.RuntimeException
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:502)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
Severity: -- → S2

I can reproduce this crash consistently by tapping on the video in https://twitter.com/jonathanmartinz/status/1415951908787916809?s=20

Same, just hit this, looks like AC to me.

Component: General → Stability
Product: GeckoView → Fenix

Lots of truncation by crash-stats

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:502)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
	... 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:883)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loop(Looper.java:241)
	at android.app.ActivityThread.main(ActivityThread.java:7582)
	... 3 more
Caused by: java.lang.ClassCastException: mozilla.components.browser.state.state.CustomTabSessionState cannot be cast to mozilla.components.browser.state.state.TabSessionState
	at mozilla.components.browser.state.reducer.-$$LambdaGroup$ks$9BszW_hrZ4nW4xydRzaP9-dhLRA.invoke(com.android.tools.r8.jetbrains.kotlin-style lambda group:52)
	at androidx.core.app.AppOpsManagerCompat.updateTabs(AppOpsManagerCompat.java:4)
	at androidx.core.app.AppOpsManagerCompat.updateTabState(AppOpsManagerCompat.java:3)
	at mozilla.components.browser.state.reducer.BrowserStateReducer.reduce(BrowserStateReducer.kt:295)
	at mozilla.components.browser.state.store.BrowserStore$1.invoke(BrowserStore.kt:3)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$chain$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.state.engine.middleware.CrashMiddleware.invoke(CrashMiddleware.kt:3)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.state.engine.middleware.TrimMemoryMiddleware.invoke(TrimMemoryMiddleware.kt:3)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.state.engine.middleware.WebExtensionMiddleware.invoke(WebExtensionMiddleware.kt:7)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.state.engine.middleware.SuspendMiddleware.invoke(SuspendMiddleware.kt:5)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.state.engine.middleware.TabsRemovedMiddleware.invoke(TabsRemovedMiddleware.kt:17)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.state.engine.middleware.LinkingMiddleware.invoke(LinkingMiddleware.kt:12)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.state.engine.middleware.CreateEngineSessionMiddleware.invoke(CreateEngineSessionMiddleware.kt:11)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.state.engine.middleware.EngineDelegateMiddleware.invoke(EngineDelegateMiddleware.kt:19)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.media.middleware.LastMediaAccessMiddleware.invoke(LastMediaAccessMiddleware.kt:3)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.search.middleware.AdsTelemetryMiddleware.invoke(AdsTelemetryMiddleware.kt:13)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.prompts.PromptMiddleware.invoke(PromptMiddleware.kt:14)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.media.middleware.RecordingDevicesMiddleware.invoke(RecordingDevicesMiddleware.kt:3)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.search.middleware.SearchMiddleware.invoke(SearchMiddleware.kt:11)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.search.region.RegionMiddleware.invoke(RegionMiddleware.kt:6)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.session.middleware.undo.UndoMiddleware.invoke(UndoMiddleware.kt:25)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.thumbnails.ThumbnailsMiddleware.invoke(ThumbnailsMiddleware.kt:27)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at org.mozilla.fenix.telemetry.TelemetryMiddleware.invoke(TelemetryMiddleware.kt:23)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.readerview.ReaderViewMiddleware.invoke(ReaderViewMiddleware.kt:17)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.downloads.DownloadMiddleware.invoke(DownloadMiddleware.kt:26)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.recentlyclosed.RecentlyClosedMiddleware.invoke(RecentlyClosedMiddleware.kt:32)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.session.middleware.LastAccessMiddleware.invoke(LastAccessMiddleware.kt:3)
	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.internal.ReducerChainBuilder$build$context$1.dispatch(ReducerChainBuilder.kt:1)
	at mozilla.components.feature.media.middleware.LastMediaAccessMiddleware.invoke(LastMediaAccessMiddleware.kt:5)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.search.middleware.AdsTelemetryMiddleware.invoke(AdsTelemetryMiddleware.kt:13)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.prompts.PromptMiddleware.invoke(PromptMiddleware.kt:14)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.media.middleware.RecordingDevicesMiddleware.invoke(RecordingDevicesMiddleware.kt:3)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.search.middleware.SearchMiddleware.invoke(SearchMiddleware.kt:11)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.search.region.RegionMiddleware.invoke(RegionMiddleware.kt:6)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.session.middleware.undo.UndoMiddleware.invoke(UndoMiddleware.kt:25)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.browser.thumbnails.ThumbnailsMiddleware.invoke(ThumbnailsMiddleware.kt:27)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at org.mozilla.fenix.telemetry.TelemetryMiddleware.invoke(TelemetryMiddleware.kt:23)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.readerview.ReaderViewMiddleware.invoke(ReaderViewMiddleware.kt:17)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.downloads.DownloadMiddleware.invoke(DownloadMiddleware.kt:26)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.recentlyclosed.RecentlyClosedMiddleware.invoke(RecentlyClosedMiddleware.kt:32)
	at mozilla.components.lib.state.internal.ReducerChainBuilder$build$$inlined$forEach$lambda$1.invoke(ReducerChainBuilder.kt:3)
	at mozilla.components.feature.session.middleware.LastAccessMiddleware.invoke(LastAccessMiddleware.kt:3)
	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:3)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.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:919)

We have a fix in Fenix that will stop the crashing over the weekend: https://github.com/mozilla-mobile/fenix/pull/20403

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → MOVED

The fix is now on Nightly Build #2015822539 published in the Play Store.

We're seeing a lot of crashes with this signature in Fenix 93. Should we open a new bug or is it the same issue as before?

Flags: needinfo?(jonalmeida942)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #6)

We're seeing a lot of crashes with this signature in Fenix 93. Should we open a new bug or is it the same issue as before?

This is a different crash entirely.

Christian, looking at the crash stacktrace here, I'm seeing references to search term parsing in HistoryMetadataMiddleware:

android.net.Uri.getQueryParameter   Uri.java:1712
mozilla.components.feature.search.ext.SearchEngineKt.parseSearchTerms  SearchEngine.kt:9
mozilla.components.feature.search.ext.SearchEngineKt$parseSearchTerms$fallback$1.invoke  SearchEngine.kt:3
mozilla.components.feature.search.ext.SearchEngineKt.parseSearchTerms  SearchEngine.kt:4
org.mozilla.fenix.historymetadata.HistoryMetadataMiddleware.createHistoryMetadata   HistoryMetadataMiddleware.kt:24
org.mozilla.fenix.historymetadata.HistoryMetadataMiddleware.invoke  HistoryMetadataMiddleware.kt:51

I found a Fenix issue filed for this crash, but no linked fixes or updates. Is this AC patch the related fix for this crash? There isn't a referenced issue, so I'm a bit uncertain.

Flags: needinfo?(jonalmeida942) → needinfo?(csadilek)

We have a fix for the crash Jonathan shared above (different one than the original one in this ticket, but same title in Socorro). We also uplifted it to A-C releases/93.0 over a week ago, but mistakenly assumed there would be another A-C 93 before release.

Ryan, so we'd need a 93.0.12 A-C and Fenix dot release. The fix is already on the branch. That was our confusion, sorry.

OK. Adding Pascal too so he's aware.

Flags: needinfo?(csadilek)

Hi, verified as fixed on Firefox 93.2.0 based on the steps provided in #21508 using the following devices:
• Google Pixel 3a (Android 11)
• Samsung Galaxy Tab S3 (Android 9)
• OnePlus A3 (Android 6.0.1)

Component: Stability → General
See Also: → 1760937
You need to log in before you can comment on or make changes to this bug.