Closed Bug 1399042 Opened 2 years ago Closed 2 years ago

Crash in java.lang.IndexOutOfBoundsException: Index: -1, Size: 16 at java.util.SubList.rangeCheck(AbstractList.java)

Categories

(Firefox for Android :: General, defect, P1, critical)

57 Branch
Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
Firefox 57
Iteration:
1.30
Tracking Status
firefox-esr52 --- unaffected
firefox55 --- unaffected
firefox56 --- unaffected
firefox57 --- fixed

People

(Reporter: calixte, Assigned: liuche)

Details

(Keywords: crash, Whiteboard: [MobileAS])

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-cea2ebdf-1cb4-46ab-b120-d01430170911.
=============================================================

There are 15 crashes in nightly 57 starting with buildid 20170902100106.
:liuche, could you investigate please ?
Flags: needinfo?(liuche)
Yes, I'm sure this is fallout from some of the newtab changes I made, so I'll take care of it.
Assignee: nobody → liuche
Iteration: --- → 1.30
Flags: needinfo?(liuche)
Whiteboard: [MobileAS]
Hm, so this is the same bug as bug 1367024, which as I look through the code, wouldn't have fixed the problem because we hit the getItemViewType first, and if the position was in fact -1, it would have hit the IllegalArgumentException rather than ArrayIndexOutOfBoundsException.

I think the problem is still the same as described before (some were-state after notifyDataSetChanged is called but before there's new data), but let's land this crash fix, and investigate later if it manifests itself in the form of missing items or lost clicks.
Comment on attachment 8907832 [details]
Bug 1399042: Move NO_POSITION check for IndexOutOfBoundsException in onItemClick.

https://reviewboard.mozilla.org/r/179530/#review184694

I wonder if these type of events can happen if a user clicks twice before the UI updates so the first click takes the action and the second hits this error.
Attachment #8907832 - Flags: review?(michael.l.comella) → review+
Pushed by michael.l.comella@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c9b73b821bd5
Move NO_POSITION check for IndexOutOfBoundsException in onItemClick. r=mcomella
For context, I found a reference to Yigit talking about how you *do* need to check for NO_POSITION in RecyclerView:
https://youtu.be/imsr8NrIAMs?t=35m45s

(The code is a little different from ours because we use a RecyclerViewClickSupport which redirects all clicks to a single listener, and does the getAdapterPosition call.)
https://hg.mozilla.org/mozilla-central/rev/c9b73b821bd5
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
You need to log in before you can comment on or make changes to this bug.