java.lang.IndexOutOfBoundsException: Invalid index <n>, size is <n> at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java) at org.mozilla.gecko.AboutHomePromoBox$<m>.onGotTypes(AboutHomePromoBox.java)

RESOLVED FIXED in Firefox 21

Status

()

defect
--
critical
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: scoobidiver, Assigned: mfinkle)

Tracking

({crash, regression, topcrash})

21 Branch
Firefox 21
ARM
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox21+ fixed)

Details

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

Attachments

(2 attachments)

It has been hit by three users in 21.0a1/20130206. The regression range is:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2360c3c46aca&tochange=bc108d2ce8d1
It's likely a regression from bug 837142.

Here is a crash report: bp-c103928f-406f-40ce-8f89-355bb2130206.

java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1
	at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
	at java.util.ArrayList.get(ArrayList.java:308)
	at org.mozilla.gecko.AboutHomePromoBox$2.onGotTypes(AboutHomePromoBox.java:153)
	at org.mozilla.gecko.AboutHomePromoBox$3.onPostExecute(AboutHomePromoBox.java:201)
	at org.mozilla.gecko.AboutHomePromoBox$3.onPostExecute(AboutHomePromoBox.java:185)
	at org.mozilla.gecko.util.GeckoAsyncTask$BackgroundTaskRunnable$1.run(GeckoAsyncTask.java:37)
	at android.os.Handler.handleCallback(Handler.java:587)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:132)
	at android.app.ActivityThread.main(ActivityThread.java:4123)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:491)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.IndexOutOfBoundsException%3A+Invalid+index+1%2C+size+is+1+at+java.util.ArrayList.throwIndexOutOfBoundsException%28ArrayList.java%29
Posted patch patchSplinter Review
I forgot to handle the case where we remove a promo choice, reducing the number of "types" available. If that happens, we need to randomize again.

This patch does not technically say "if any of the available promo types is removed or added, please randomize". It's kinda more simple than that and says "if the type index from last time is out-of-range, randomize again". This should still work and show a new promo.

There is already a check for no promo types, so we don't need to add anything new for that.
Assignee: nobody → mark.finkle
Attachment #710892 - Flags: review?(wjohnston)
It's #2 top crasher over the last day.
Keywords: topcrash
Wes - Review ping?
Comment on attachment 710892 [details] [diff] [review]
patch

Over to Brian
Attachment #710892 - Flags: review?(wjohnston) → review?(bnicholson)
Attachment #710892 - Flags: review?(bnicholson) → review+
https://hg.mozilla.org/mozilla-central/rev/ded7b4099975
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
It's not fixed. See bp-effe19eb-ac9f-4e10-87d6-d387c2130209.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I am obviously a bit rusty in my zero-based array size checks
Attachment #712138 - Flags: review?(bnicholson)
(In reply to Mark Finkle (:mfinkle) from comment #8)
> Created attachment 712138 [details] [diff] [review]
> patch 2: stupid mistake
> 
> I am obviously a bit rusty in my zero-based array size checks

Tested the patch and it does stop the crash
Comment on attachment 712138 [details] [diff] [review]
patch 2: stupid mistake

Oops, sorry for not catching this in the first patch.
Attachment #712138 - Flags: review?(bnicholson) → review+
https://hg.mozilla.org/mozilla-central/rev/f10c91f4206e
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.