java.lang.IllegalArgumentException: invalid selection offsets at org.mozilla.gecko.GeckoEditable$Action.newSetSelection(GeckoEditable.java)

RESOLVED FIXED in Firefox 20

Status

()

--
critical
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: scoobidiver, Assigned: jchen)

Tracking

({crash})

Trunk
Firefox 20
ARM
Android
crash
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(firefox20 fixed)

Details

(Whiteboard: [native-crash], crash signature)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
There's one crash in 20.0a1/20121214 after the fix of bug 814886: bp-90848fc8-ebcc-424f-9c64-a9ab42121215.

java.lang.IllegalArgumentException: invalid selection offsets
	at org.mozilla.gecko.GeckoEditable$Action.newSetSelection(GeckoEditable.java:138)
	at org.mozilla.gecko.GeckoEditable.setSpan(GeckoEditable.java:764)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at org.mozilla.gecko.GeckoEditable.invoke(GeckoEditable.java:719)
	at $Proxy0.setSpan(Native Method)
	at android.text.Selection.setSelection(Selection.java:78)
	at android.view.inputmethod.BaseInputConnection.setSelection(BaseInputConnection.java:487)
	at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:288)
	at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4447)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.IllegalArgumentException%3A+invalid+selection+offsets+at+org.mozilla.gecko.GeckoEditable%24Action.newSetSelection%28GeckoEditable.java%29
(Assignee)

Comment 1

6 years ago
Created attachment 694109 [details] [diff] [review]
Specify valid selection offsets in onCreateInputConnection (v1)

Asking Brad to review since I'm already asking Chris to review a couple other patches

This is a speculative fix. I could not reproduce and the stack is not helpful, but I think the fact that we specify -1 as the initial selection offsets is causing some IMEs to calculate wrong selection offsets (even though -1 is a valid value according to the docs). This patch makes it return the actual selection offsets so hopefully this crash will no longer appear.
Attachment #694109 - Flags: review?(blassey.bugs)
Attachment #694109 - Flags: review?(blassey.bugs) → review+
(Assignee)

Comment 2

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/7d531752a0fb
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/7d531752a0fb
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
status-firefox20: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
(Assignee)

Updated

6 years ago
Depends on: 825120
You need to log in before you can comment on or make changes to this bug.