Open Bug 1822621 Opened 3 years ago Updated 15 days ago

Crash in [@ java.lang.IllegalStateException: at org.mozilla.geckoview.GeckoSession$SelectionActionDelegate$Selection.execute(GeckoSession.java)]

Categories

(GeckoView :: General, defect, P3)

Unspecified
Android
defect

Tracking

(firefox111 affected, firefox112 affected, firefox113 affected)

Tracking Status
firefox111 --- affected
firefox112 --- affected
firefox113 --- affected

People

(Reporter: cpeterson, Unassigned, NeedInfo)

Details

(Keywords: crash)

Crash Data

This is a long-standing crash going back to at least Fenix 86.

Crash report: https://crash-stats.mozilla.org/report/index/460cacfc-d6bb-4d36-94d4-9fa820230315

Java stack trace:

java.lang.IllegalStateException: Action not available
	at org.mozilla.geckoview.GeckoSession$SelectionActionDelegate$Selection.execute(GeckoSession.java:53)
	at org.mozilla.geckoview.BasicSelectionActionDelegate.performAction(BasicSelectionActionDelegate.java:35)
	at mozilla.components.browser.engine.gecko.selection.GeckoSelectionActionDelegate.performAction(GeckoSelectionActionDelegate.kt:29)
	at org.mozilla.geckoview.BasicSelectionActionDelegate.onActionItemClicked(BasicSelectionActionDelegate.java:73)
	at org.mozilla.geckoview.BasicSelectionActionDelegate$Callback2Wrapper.onActionItemClicked(BasicSelectionActionDelegate.java:3)
	at com.android.internal.policy.DecorView$ActionModeCallback2Wrapper.onActionItemClicked(DecorView.java:5665)
	at com.android.internal.view.FloatingActionMode$3.onMenuItemSelected(FloatingActionMode.java:97)
	at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:788)
	at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:160)
	at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:935)
	at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:925)
	at com.android.internal.view.FloatingActionMode.lambda$setFloatingToolbar$0$com-android-internal-view-FloatingActionMode(FloatingActionMode.java:128)
	at com.android.internal.view.FloatingActionMode$$ExternalSyntheticLambda0.onMenuItemClick(Unknown Source:2)
	at com.android.internal.widget.floatingtoolbar.LocalFloatingToolbarPopup$2.onClick(LocalFloatingToolbarPopup.java:203)
	at android.view.View.performClick(View.java:7881)
	at android.view.View.performClickInternal(View.java:7858)
	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
	at android.view.View$PerformClick.run(View.java:30863)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8741)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Crash volume is pretty low.

Priority: P2 → P3

This bug has had no comment from a person since 2023-04-04. Clouseau analysed a recent crash report on its signature; the analysis is below.

Crash report: https://crash-stats.mozilla.org/report/index/8922dbb8-6c8c-4c8b-b289-1b4480261022

Top 10 frames:

0  okio.Buffer$$ExternalSyntheticBUOutline3  m
1  org.mozilla.geckoview.GeckoSession$SelectionActionDelegate$Selection  execute  mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
2  org.mozilla.geckoview.BasicSelectionActionDelegate  performAction  mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
3  mozilla.components.browser.engine.gecko.selection.GeckoSelectionActionDelegate  performAction  mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/selection/GeckoSelectionActionDelegate.kt
4  org.mozilla.geckoview.BasicSelectionActionDelegate  onActionItemClicked  mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
5  org.mozilla.geckoview.BasicSelectionActionDelegate$Callback2Wrapper  onActionItemClicked  mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
6  com.android.internal.policy.DecorView$ActionModeCallback2Wrapper  onActionItemClicked
7  com.android.internal.view.FloatingActionMode$3  onMenuItemSelected
8  com.android.internal.view.menu.MenuBuilder  dispatchMenuItemSelected
9  com.android.internal.view.menu.MenuItemImpl  invoke

There are 218 crashes (from 194 installations) in 158.0.2 starting with buildid 20261021001945.

In the last 30 days, Fenix has 4173 crashes (from 3614 installations) on release, 81 crashes (from 69 installations) on nightly and 74 crashes (from 69 installations) on beta with this signature.

This signature has been reported since build 20260901215037 (2026-09-01), 49 days before the build above.

This bug looks actionable because:

  • Tapping a floating text-selection toolbar item crashes Fenix with IllegalStateException("Action not available") in GeckoSession.SelectionActionDelegate.Selection.execute, when the action ID is not in the current Selection's availableActions.

    1. BasicSelectionActionDelegate.onActionItemClicked turns the tapped menu item into an action ID by indexing getAllActions() with the item ID, not by asking the current selection.
    2. onShowActionRequest replaces mSelection with each new Gecko Selection but only calls mActionMode.invalidate() on the open toolbar, so items built for an earlier selection can probably still be tapped.
    3. BasicSelectionActionDelegate.performAction checks only mSelection != null and then calls mSelection.execute(id) without checking isActionAvailable(id).
    4. Selection.execute throws IllegalStateException because the ID is not in availableActions.

    The stack matches this path exactly (Callback2Wrapper.onActionItemClicked, then GeckoSelectionActionDelegate.performAction, then BasicSelectionActionDelegate.performAction, then Selection.execute). Frame 0 is an R8 outline of the throw. The report does not say which action was tapped. A second, less likely route is a custom action that the custom delegate declines and that falls through to super.performAction. The place to look first is BasicSelectionActionDelegate.performAction: return false (or re-validate the menu) when isActionAvailable(id) is false, instead of calling Selection.execute, which is documented to throw.

  • The failing code comes from 1fa64c7fe170 (bug 1571899) by :agi.

Code references:

:owlish, as triage owner, can you have a look please?

Posted automatically by Clouseau, which analyses release crashes with an LLM. Nothing above was written or checked by a human.

Posted here because this crash's first internal frame java.lang.IllegalStateException: at org.mozilla.geckoview.GeckoSession$SelectionActionDelegate$Selection.execute(GeckoSession.java) is on this bug. Its signature java.lang.IllegalStateException: at okio.Buffer$$ExternalSyntheticBUOutline3.m(R8$$SyntheticClass:3) is an R8 outline frame shared by unrelated crashes, so it was not added to this bug.

Flags: needinfo?(bugzeeeeee)
You need to log in before you can comment on or make changes to this bug.