Closed Bug 781038 Opened 12 years ago Closed 6 years ago

java.lang.IndexOutOfBoundsException: setSpan (<a> ... <b>) ends beyond length 0

Categories

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

ARM
Android
defect

Tracking

(firefox15 affected, firefox16 affected, firefox17 affected, firefox18 affected)

RESOLVED WONTFIX
Firefox 17
Tracking Status
firefox15 --- affected
firefox16 --- affected
firefox17 --- affected
firefox18 --- affected

People

(Reporter: cpeterson, Unassigned)

References

Details

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

Crash Data

Attachments

(2 files)

This bug was filed from the Socorro interface and is 
report bp-6cab57f1-6c4f-4652-a831-2bb3b2120804 .
============================================================= 

We've seen at least two crash reports where Firefox tries to select a zero-length string. I suspect our call to mEditable.replace(content) is not succeeding, leaving mEditable with a zero-length string.
Part 1: Span and select the Editable's actual length (not the length we hope it will be).
Attachment #649868 - Flags: review?(blassey.bugs)
Part 2: Extract setSpan() and setSelection() boilerplate into a convenience method.

Also collapse extraneous initEditable() method into GeckoInputConnection's constructor.
Attachment #649870 - Flags: review?(blassey.bugs)
Attachment #649868 - Flags: review?(blassey.bugs) → review+
Attachment #649870 - Flags: review?(blassey.bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/3422d26da179
https://hg.mozilla.org/mozilla-central/rev/8fbaea0f82e8
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Crash Signature: android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)] → android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)] [@ java.lang.IndexOutOfBoundsException: setSpan (0 ... 16313) ends beyond length 0 at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)]
Comment on attachment 649868 [details] [diff] [review]
part-1-select-editable-length.patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): N/A
User impact if declined: Socorro reports just a few crash reports from Beta 15, Aurora 16, and Nightly 17 users.
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): Low risk because the patch is just double-checking the string length before copying.
String or UUID changes made by this patch: N/A
Attachment #649868 - Flags: approval-mozilla-aurora?
Patch 2 does not need to be uplifted because it is just a minor refactoring.
Attachment #649868 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
This crash was not reproduced at all on any branch past 4 weeks. I cannot reproduce it either on the latest Nightly. Closing bug as verified fixed.

--
Firefox 18.0a1 (2012-09-17)
Device: Galaxy Note
OS: Android 4.0.4
Status: RESOLVED → VERIFIED
(In reply to Cristian Nicolae (:xti) from comment #10)
> This crash was not reproduced at all on any branch past 4 weeks. I cannot
> reproduce it either on the latest Nightly. Closing bug as verified fixed.
I don't understand how you can be sure it's not reproducible without STR and it no longer happens with so many crashes: https://crash-stats.mozilla.com/query/query?product=FennecAndroid&version=ALL%3AALL&query_search=signature&query_type=contains&query=android.text.SpannableStringBuilder.checkRange&do_query=1
Can you clarify that?
This bug lives again because I backed out the fix (to deal with a regression).
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
(In reply to Scoobidiver from comment #11)
> Can you clarify that?

I checked the crash reports, on what build number and dates were reported to make sure that everything is fine on m-a and m-c. Since Chris has backed out the fix, it means that's opened again, as already mentioned.
Whiteboard: [native-crash]
Assignee: cpeterson → nobody
Status: REOPENED → NEW
Summary: java.lang.IndexOutOfBoundsException: setSpan (0 ... 27299) ends beyond length 0 → java.lang.IndexOutOfBoundsException: setSpan (<a> ... <b>) ends beyond length 0
Crash Signature: android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)] [@ java.lang.IndexOutOfBoundsException: setSpan (0 ... 16313) ends beyond length 0 at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)] → android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)] [@ java.lang.IndexOutOfBoundsException: setSpan (0 ... 16313) ends beyond length 0 at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java)] [@ java.lang…
Closing because no crash reported since 12 weeks.
Status: NEW → RESOLVED
Closed: 12 years ago6 years ago
Resolution: --- → WONTFIX
Closing because no crash reported since 12 weeks.
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: