Note: There are a few cases of duplicates in user autocompletion which are being worked on.

java.lang.StringIndexOutOfBoundsException: at java.lang.String.substring(String.java) at org.mozilla.gecko.GeckoInputConnection.notifyTextChange(GeckoInputConnection.java)

RESOLVED FIXED in Firefox 15

Status

()

Firefox for Android
Keyboards and IME
--
critical
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Scoobidiver (away), Assigned: cpeterson)

Tracking

({crash})

Trunk
Firefox 17
ARM
Android
crash
Points:
---

Firefox Tracking Flags

(firefox15 fixed, firefox16 fixed, firefox17 fixed)

Details

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

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
There are two crashes in 17.0a1/20120718 and one in 15.0a2/20120716. Here is a crash report: bp-8140dbef-2cd7-4331-aa7e-d4b4e2120719.

java.lang.StringIndexOutOfBoundsException
	at java.lang.String.substring(String.java:1651)
	at org.mozilla.gecko.GeckoInputConnection.notifyTextChange(GeckoInputConnection.java:490)
	at org.mozilla.gecko.GeckoInputConnection$3.run(GeckoInputConnection.java:1081)
	at android.os.Handler.handleCallback(Handler.java:587)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:130)
	at android.app.ActivityThread.main(ActivityThread.java:3691)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:507)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.StringIndexOutOfBoundsException%3A+at+java.lang.String.substring%28String.java%29
(Assignee)

Updated

5 years ago
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
status-firefox15: --- → affected
status-firefox17: --- → affected
(Assignee)

Comment 1

5 years ago
Created attachment 644006 [details] [diff] [review]
part-1-clamp-extracted-text-updates.patch

Part 1: Clamp string indexes when updating IME extracted text.

I'd like to uplift this "can't happen" bug fix to Aurora 16 and possibly Beta 15.

The patch adds an IllegalArgumentException, but it is only thrown from DEBUG code.
Attachment #644006 - Flags: review?(blassey.bugs)
(Assignee)

Comment 2

5 years ago
Created attachment 644007 [details] [diff] [review]
part-2-pretty-print-text.patch

Part 2: Pretty-print IME strings to logcat (to make debugging editing of long text fields easier).

Patch 1 could be uplifted without patch 2. This patch only affects DEBUG logging.
Attachment #644007 - Flags: review?(blassey.bugs)
Attachment #644006 - Flags: review?(blassey.bugs) → review+
Attachment #644007 - Flags: review?(blassey.bugs) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/9c7958769c7e
https://hg.mozilla.org/integration/mozilla-inbound/rev/7cb719c527e5
status-firefox16: --- → affected
status-firefox17: affected → fixed
Target Milestone: --- → Firefox 17
https://hg.mozilla.org/mozilla-central/rev/9c7958769c7e
https://hg.mozilla.org/mozilla-central/rev/7cb719c527e5
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Assignee)

Comment 5

5 years ago
Comment on attachment 644006 [details] [diff] [review]
part-1-clamp-extracted-text-updates.patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: Some low frequency IME crashes.
Testing completed (on m-c, etc.): Baked on m-c for 2 days. In the past 3 days, there have been 0 StringIndexOutOfBoundsExceptions on Nightly 17, 1 on Aurora 16, and 18 on Beta 15. So this patch seems to be helping.
Risk to taking this patch (and alternatives if risky): Low risk. The patch just adds some string length checks.
String or UUID changes made by this patch: N/A
Attachment #644006 - Flags: approval-mozilla-beta?
Attachment #644006 - Flags: approval-mozilla-aurora?
Attachment #644006 - Flags: approval-mozilla-beta?
Attachment #644006 - Flags: approval-mozilla-beta+
Attachment #644006 - Flags: approval-mozilla-aurora?
Attachment #644006 - Flags: approval-mozilla-aurora+
(Assignee)

Comment 6

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/e061fdd4ab2f
status-firefox16: affected → fixed
(Assignee)

Comment 7

5 years ago
https://hg.mozilla.org/releases/mozilla-beta/rev/a6994473b0b4
status-firefox15: affected → fixed
You need to log in before you can comment on or make changes to this bug.