Closed Bug 1151910 Opened 9 years ago Closed 9 years ago

testCheck2 sometimes throws java.lang.ArrayIndexOutOfBoundsException

Categories

(Firefox for Android Graveyard :: Testing, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox40 fixed)

RESOLVED FIXED
Firefox 40
Tracking Status
firefox40 --- fixed

People

(Reporter: gbrown, Assigned: gbrown)

Details

Attachments

(1 file)

There's no sign of a test failure here, but some logs for Talos testCheck2 (rck2) show an exception being thrown and caught.

http://ftp.mozilla.org/pub/mozilla.org/mobile/tinderbox-builds/mozilla-central-android-api-11/1428360480/mozilla-central_panda_android_test-remote-trobocheck2-bm100-tests1-panda-build102.txt.gz

16:59:25     INFO -  INFO : Exception while replaying events: java.lang.ArrayIndexOutOfBoundsException: length=2048; index=-1 [browser_output.txt]
I reproduced with additional logging.

09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): java.lang.ArrayIndexOutOfBoundsException: length=2048; index=-1
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at java.util.ArrayList.get(ArrayList.java:306)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at org.mozilla.gecko.gfx.PanningPerfAPI.stopCheckerboardRecording(PanningPerfAPI.java:106)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at org.mozilla.gecko.FennecNativeDriver.stopCheckerboardRecording(FennecNativeDriver.java:161)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at org.mozilla.gecko.tests.testCheck2.testCheck2(testCheck2.java:62)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at java.lang.reflect.Method.invokeNative(Native Method)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at java.lang.reflect.Method.invoke(Method.java:511)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at org.mozilla.gecko.tests.BaseTest.runTest(BaseTest.java:135)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at junit.framework.TestCase.runBare(TestCase.java:127)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at junit.framework.TestResult$1.protect(TestResult.java:106)
09:08:13     INFO -  04-08 09:07:02.867 W/System.err( 2804): 	at junit.framework.TestResult.runProtected(TestResult.java:124)
09:08:13     INFO -  04-08 09:07:02.875 W/System.err( 2804): 	at junit.framework.TestResult.run(TestResult.java:109)
09:08:13     INFO -  04-08 09:07:02.875 W/System.err( 2804): 	at junit.framework.TestCase.run(TestCase.java:118)
09:08:13     INFO -  04-08 09:07:02.875 W/System.err( 2804): 	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
09:08:13     INFO -  04-08 09:07:02.875 W/System.err( 2804): 	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
09:08:13     INFO -  04-08 09:07:02.875 W/System.err( 2804): 	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:545)
09:08:13     INFO -  04-08 09:07:02.875 W/System.err( 2804): 	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1551)
09:08:13     INFO -  04-08 09:07:02.875 I/Robocop ( 2804): __FAILException while replaying events: java.lang.ArrayIndexOutOfBoundsException: length=2048; index=-1__FAIL
The stack I reported in Comment 1 was obtained from an altered testCheck2, so I'm not sure that the exceptions seen on treeherder have an identical cause, but the index and length are the same, so it seems likely. At any rate, it is possible that the array is empty; we should handle that case.
Attachment #8590454 - Flags: review?(bugmail.mozilla)
Comment on attachment 8590454 [details] [diff] [review]
guard against array index out of bounds

Review of attachment 8590454 [details] [diff] [review]:
-----------------------------------------------------------------

Lgtm
Attachment #8590454 - Flags: review?(bugmail.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/2a7d393b7dc0
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
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: