Closed Bug 788106 Opened 12 years ago Closed 12 years ago

java.lang.ArrayIndexOutOfBoundsException: at org.mozilla.gecko.FontSizePreference$<n>.onClick(FontSizePreference.java)

Categories

(Firefox for Android Graveyard :: General, defect)

17 Branch
ARM
Android
defect
Not set
critical

Tracking

(firefox17 affected)

RESOLVED FIXED
Firefox 20
Tracking Status
firefox17 --- affected

People

(Reporter: scoobidiver, Assigned: mcomella)

References

Details

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

Crash Data

Attachments

(2 files)

There's one crash in 18.0a1/20120903: bp-26423dd9-48ce-482b-8b01-0b62a2120904.

java.lang.ArrayIndexOutOfBoundsException: length=5; index=5
	at org.mozilla.gecko.FontSizePreference$2.onClick(FontSizePreference.java:94)
	at android.view.View.performClick(View.java:3511)
	at android.view.View$PerformClick.run(View.java:14105)
	at android.os.Handler.handleCallback(Handler.java:605)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4424)
	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.ArrayIndexOutOfBoundsException%3A+length%3D5%3B+index%3D5+at+org.mozilla.gecko.FontSizePreference%242.onClick%28FontSizePreference.java%29
Funnily enough, I think I did this. :D

I pressed the enlarge text button in the dialog to change index 3 to index 4 (the maximum index) and it crashed. I'll look into it.
Assignee: nobody → michael.l.comella
Crash Signature: [@ java.lang.ArrayIndexOutOfBoundsException: length=5; index=5 at org.mozilla.gecko.FontSizePreference$2.onClick(FontSizePreference.java)] → [@ java.lang.ArrayIndexOutOfBoundsException: length=5; index=5 at org.mozilla.gecko.FontSizePreference$2.onClick(FontSizePreference.java)] [@ java.lang.ArrayIndexOutOfBoundsException: at org.mozilla.gecko.FontSizePreference$2.onClick(FontSizePreference.j…
Summary: java.lang.ArrayIndexOutOfBoundsException: at org.mozilla.gecko.FontSizePreference$2.onClick(FontSizePreference.java) → java.lang.ArrayIndexOutOfBoundsException: at org.mozilla.gecko.FontSizePreference$<n>.onClick(FontSizePreference.java)
Version: Trunk → Firefox 17
Attached patch 02: Band-aid fixSplinter Review
The code, in the current state, relies on the button being disabled to prevent this exception from happening. However, when I caused the initial crash report, I hit the enlarge font button once to set the font to the maximum size but the button seemed to have triggered onClick() twice before the method ran once. Thus, the button was not disabled for the second call, causing the out-of-bounds exception and crash.

To figure out how this is could possibly happen (and thus the best possible fix) would require jumping into the Android source code, which I don't really have time to do. Also, it's probably not worth the time for a one-time use dialog.

This patch should work as a band-aid, preventing the exception from occurring.

Note that I have been unable to consistently repo this crash.
Attachment #682785 - Flags: review?(bnicholson)
Attachment #682785 - Flags: review?(bnicholson) → review+
Attachment #682784 - Flags: review?(bnicholson) → review+
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/33493f12809d
https://hg.mozilla.org/mozilla-central/rev/296a47893d90
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: