Closed
Bug 1208036
Opened 9 years ago
Closed 9 years ago
crash in java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java)
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(fennec44+)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
fennec | 44+ | --- |
People
(Reporter: kats, Assigned: sebastian)
References
Details
(Keywords: crash)
Crash Data
Attachments
(1 file)
This bug was filed from the Socorro interface and is
report bp-4ae1cbd4-6d63-4c02-a19d-4a9912150924.
=============================================================
I hit this crash twice this morning. Don't have STR but both times I had two tabs open and I had gone into the tabs tray to close one.
Comment 2•9 years ago
|
||
I'm also seeing this a couple times a day when closing tabs from the tab tray.
Blocks: tabs-tray
Updated•9 years ago
|
tracking-fennec: --- → ?
Updated•9 years ago
|
Assignee: nobody → mhaigh
tracking-fennec: ? → 44+
Comment 3•9 years ago
|
||
Bug 1208036 - crash in java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java); r?mcomella
Attachment #8669034 -
Flags: review?(michael.l.comella)
Comment on attachment 8669034 [details]
MozReview Request: Bug 1208036 - crash in java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java); r?mcomella
https://reviewboard.mozilla.org/r/21115/#review19027
This would fix the crash, but catching `IndexOutOfBoundsException` seems like a code smell.
::: mobile/android/base/tabs/TabsGridLayout.java:284
(Diff revision 1)
> + // An item may have been removed since we posted the runnable - lets make sure not to crash if
While it's true that is possible, we get the adapter item count in the Runnable so it shouldn't be relevant (unless the adapter internal state can be inconsistent).
I think the issue is more likely to be that the tabsAdapter is getting updated as we iterate over it, either from `refreshTabsData`, `tabsAdapter.removeTab`, or `tabsAdapter.clear`. I think the best solutions would be to ensure all access to tabsAdapter's items are on the UiThread, followed by synchronizing it during iteration.
Have you looked into these at all?
Attachment #8669034 -
Flags: review?(michael.l.comella)
Updated•9 years ago
|
Assignee: mhaigh → s.kaspari
Flags: needinfo?(mhaigh)
Assignee | ||
Updated•9 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•9 years ago
|
||
I tried to find the code path that modifies the list on a non-UI thread and additionally spread ThreadUtils.assertOnUiThread() everywhere to catch something, but without any success.
So I went ahead and looked at the recent changes and maybe this has already been fixed here:
https://hg.mozilla.org/mozilla-central/rev/015612bc2208
Originally the loop used getChildCount() on the view instead getCount() on the adapter. So theoretically they could diverge temporarily.
I wonder if anyone has seen this crash recently? I tried to find more crash reports, but there are so many different IndexOutOfBoundsException reports. All related crashes on 44.0a1 seem to point to Build ID 20150923030230.
This code has been introduced/pushed on 015-09-22 23:39 +0000 and the change above was pushed 2015-09-23 20:22 +0000. So maybe this crash only occurred in ~1 Nightly build.
Assignee | ||
Comment 6•9 years ago
|
||
I just downloaded Nightly build 20150923030230[1] and I have been able to reproduce this crash[2] (while swiping tabs away fast and at the same time pressing undo on the toast to get new tabs to swipe away..). I tried to do the same with the latest app but we are now closing the tabs tray when the last tab is closed[3].
[1] http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/2015-09-23-03-02-30-mozilla-central-android-api-11/fennec-44.0a1.multi.android-arm.apk
[2] java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1
[3] https://hg.mozilla.org/mozilla-central/rev/9629c91c939b
Assignee | ||
Comment 7•9 years ago
|
||
I disabled closing the tabs tray locally and with reverting back to childCount I can crash the app.
In some situations childCount and adapter count can diverge temporarily:
> 10-09 15:17:51.372 13370-13370/org.mozilla.fennec_sebastian D/SKDBG﹕ childCount: 2
> 10-09 15:17:51.372 13370-13370/org.mozilla.fennec_sebastian D/SKDBG﹕ adapter: 1
With the change to tabAdapter.getCount() in 015612bc2208 this Crash should be gone.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•