Hello all

Hopefully someone out there can shed some light on this one, because
it's got me completely stumped.

I've received 5 reports, from 3 separate users on 2 different devices
(ZTE blade and HTC Liberty), of an ArrayIndexOutOfBoundsException that
I simply cannot explain.

The stacktrace:
java.lang.ArrayIndexOutOfBoundsException
at com.ryanm.droid.rugl.util.geom.Frustum.extractFromOGL(Frustum.java:
180)
at com.ryanm.droid.rugl.util.FPSCamera.setPosition(FPSCamera.java:174)
at com.ryanm.minedroid.BlockView.draw(BlockView.java:318)
at com.ryanm.droid.rugl.Game.onDrawFrame(Game.java:247)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:
1332)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
...

You can view the offending file here:
http://code.google.com/p/rugl/source/browse/trunk/droid/DroidRUGL/src/com/ryanm/droid/rugl/util/geom/Frustum.java

Line 180 is:
   frustum[ 3 ][ 0 ] /= t;
However, the frustum array is declared as:
   private final float[][] frustum = new float[ 6 ][ 4 ];
so 3 and 0 are perfectly valid indices. The frustum array is not
altered after declaration - it's private and there are only 4 "new"s
in that file, none of which are redeclaring any of the frustum[]
arrays. In addition, line 172 is:
    frustum[ 3 ][ 0 ] = clip[ 3 ] - clip[ 1 ];
and no error is raised.

Possible causes that I've eliminated:
1) Different versions of the class, so line numbers don't match up - I
wish it were that easy. The code was copied wholesale (url in the
class javadoc), javafied and committed. I haven't touched it since so
there are no other versions of this class.
2) Someone else has taken the code, b0rked it, and is distributing
broken APKs - Seems unlikely, and the one user who responded to me
claims he downloaded directly from my site.
3) The crash report is being mangled somewhere in the reporting
process - I'm using this class:
http://code.google.com/p/rugl/source/browse/trunk/droid/DroidRUGL/src/com/ryanm/droid/rugl/util/ExceptionHandler.java
to capture exceptions. If someone can explain how that can mangle
reports sufficiently, I'd be grateful.

Remaining possibilities:
1) Malicious users fabricating error reports - I'd have hoped that
three people would have better things to do than to conspire to troll
me with bizarre crash reports, but I suppose anything is possible :-/
2) VM bug

It's always a sad state of affairs when it comes down to blaming the
VM, especially for such innocuous code. I very much enjoy trusting the
VM and knowing that any bugs are my own, but I just don't know what
else to make of this.
I'd be enormously grateful if someone could point out where I've gone
wrong.

On a side note, having AIOOBEs report the value of the incorrect index
-as in the JVM- would have been very handy in this case.

Regards

Ryan McNally

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to