Hello again The last oddity ( http://groups.google.com/group/android-developers/browse_thread/thread/72cf40ad9615835c ) has proved to be a heisenbug - since adding more error logging it has not surfaced again.
I'm now facing a similar situation - an apparently impossible ArrayIndexOutOfBoundsException - only this time I have 6 reports from 6 different users, 5 using HTC Wildfires and one on an HTC Magic The exception: java.lang.ArrayIndexOutOfBoundsException at com.ryanm.droid.rugl.gl.Renderer.addGeometry(Renderer.java:334) ... The code can be viewed here: http://code.google.com/p/rugl/source/browse/trunk/droid/DroidRUGL/src/com/ryanm/droid/rugl/gl/Renderer.java It's a bit more involved than last time, so I'll step interested parties through it. The class is a batched geometry renderer - you pass it geometry associated with an OpenGL state object and the geometry is sorted into bins, batching up similar GL states so as to minimise state changes when we come to render. The class maintains a sorted list of GL state objects that it has encountered before, and assigns each element of the list an index into the array of geometry batches. It is this index that the exception is being triggered by. Looking at the offending addGeometry() method, we see that the state object is assigned by the intern() method, wherein the list of encountered states is maintained. intern() (line 142) has three possible outcomes: 1) The passed state object is already in the pool of known states - it is simply returned 2) There is an equivalent state in the pool already - the pooled state is returned 3) There is no equivalent - the passed state is added to the pool at the appropriate position. The indices of all pooled states are updated by the loop at line 166 - there is no way for the assigned index to fall outside the range 0 to poolSize-1. On line 174, the array that we later thow the AIOOBE on is resized to be poolSize elements in length. This array is successfully indexed by the returned State - no exception is thrown here (line 175) In all three outcomes, a state object that is in the pool is returned. I can see no way in which a state can enter the pool and not have a valid index. Note: There is no multithreading at play here intern() is the only place in which the state indices are assigned intern() is the only place in which the pool of encountered states is manipulated, or even referred to intern() is the only place in which the geometry batch array is assigned If someone could point out the obvious oversight I'm making, I'd be grateful. Otherwise I'll just stick some more error logging in here and never actually encounter the error again :-/ Ryan -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

