Closed
Bug 1123514
Opened 11 years ago
Closed 9 years ago
crash in java.lang.IndexOutOfBoundsException: replace (1261 ... 1260) has end before start at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)
Categories
(Firefox for Android Graveyard :: Keyboards and IME, defect)
Tracking
(firefox52 fixed)
RESOLVED
FIXED
Firefox 52
| Tracking | Status | |
|---|---|---|
| firefox52 | --- | fixed |
People
(Reporter: david.weir, Unassigned)
References
Details
(Keywords: crash)
Crash Data
Attachments
(2 files)
|
3.33 KB,
patch
|
esawin
:
review+
|
Details | Diff | Splinter Review |
|
3.23 KB,
patch
|
esawin
:
review+
|
Details | Diff | Splinter Review |
This bug was filed from the Socorro interface and is
report bp-5634f951-6ccb-4af9-bd68-a22d02150120.
=============================================================
This crashed on etherpad today
Comment 1•11 years ago
|
||
java.lang.IndexOutOfBoundsException: replace (1261 ... 1260) has end before start
at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1009)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:441)
at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:212)
at org.mozilla.gecko.GeckoEditable.geckoReplaceText(GeckoEditable.java:861)
at org.mozilla.gecko.GeckoEditable.onTextChange(GeckoEditable.java:942)
at org.mozilla.gecko.GeckoAppShell.notifyIMEChange(GeckoAppShell.java:488)
at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
at org.mozilla.gecko.GeckoAppShell.runGecko(GeckoAppShell.java:325)
at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:184)
Can you provide steps to reproduce? Do you crash on Nightly https://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-android-api-11/fennec-38.0a1.multi.android-arm.apk?
| Reporter | ||
Comment 2•11 years ago
|
||
Was looking through websites then went to
https://contributors.etherpad.mozilla.org/smjan2015
Once I was there started typing and it crasher
Flags: needinfo?(david.weir)
Updated•10 years ago
|
Crash Signature: [@ java.lang.IndexOutOfBoundsException: replace (1261 ... 1260) has end before start at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)] → [@ java.lang.IndexOutOfBoundsException: replace (1261 ... 1260) has end before start at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)]
[@ java.lang.IndexOutOfBoundsException: replace has end before start at android.text.Span…
Comment 4•9 years ago
|
||
Add a test that creates conditions for wrong offset calculation and
potentially causes an exception.
Attachment #8807299 -
Flags: review?(esawin)
Comment 5•9 years ago
|
||
Fix a mistake in calculating the correct offset for one of the replacement
steps, which caused the IndexOutOfBoundsException. The old code used `oldEnd`
for the second text replacement without taking into account the offset change
as a result of the first text replacement that was already performed. The new
code correctly takes the offset, `delta`, into account.
Attachment #8807300 -
Flags: review?(esawin)
Updated•9 years ago
|
Attachment #8807299 -
Flags: review?(esawin) → review+
Comment 6•9 years ago
|
||
Comment on attachment 8807300 [details] [diff] [review]
Correctly calculate text replacement offset (v1)
Review of attachment 8807300 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoEditable.java
@@ +1229,5 @@
> // replacement in parts. First replace part of text before the sequence.
> mText.currentReplace(start, action.mStart, text.subSequence(0, indexInText));
>
> // Then replace part of the text after the sequence.
> + final int delta = indexInText + start - action.mStart;
I think it's clearer to leave actionStart and additionally add delta instead of replacing it.
Attachment #8807300 -
Flags: review?(esawin) → review+
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/803d5895353d
Add test for wrong offset calculation; r=esawin
https://hg.mozilla.org/integration/mozilla-inbound/rev/7fa6baac8f37
Correctly calculate text replacement offset; r=esawin
Comment 8•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/803d5895353d
https://hg.mozilla.org/mozilla-central/rev/7fa6baac8f37
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
Comment 9•3 years ago
|
||
Removing steps-wanted keyword because this bug has been resolved.
Keywords: steps-wanted
You need to log in
before you can comment on or make changes to this bug.
Description
•