Closed Bug 822755 Opened 12 years ago Closed 12 years ago

ANR when GeckoEditable responds to stale actions

Categories

(Firefox for Android Graveyard :: Keyboards and IME, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 20

People

(Reporter: jchen, Assigned: jchen)

Details

Attachments

(1 file)

I've seen an ANR situation where GeckoEditable is replying to stale actions. The rough sequence of events are:

1) InputConnection method called on UI side; UI sends action to Gecko
2) Focus changes in Gecko
3) Gecko generates text change event for new focus
4) Gecko receives the stale action from step 1; nothing is done on Gecko side but reply is sent back to UI
5) UI responds to reply and because the text no longer matches the old text, it throws an exception
6) the action is never removed from the action queue due to unhandled exception, and subsequent sync attempts will block permanently

The solution is to skip events when action replies are stale, and also catch exceptions so that action queue items are always removed.
This patch guards against stale actions and always removes action from queue even if exception is thrown when processing the reply
Attachment #694099 - Flags: review?(cpeterson)
Comment on attachment 694099 [details] [diff] [review]
Don't process reply and always remove from action queue when processing stale actions (v1)

Review of attachment 694099 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM!
Attachment #694099 - Flags: review?(cpeterson) → review+
https://hg.mozilla.org/mozilla-central/rev/d7b8336e01d1
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: