Hello,
I am having a similar case with a JVM crash, but when using
glMultiDrawElements() and vertex arrays. I checked all the things that Keith mentioned above and all seem to be done right. It is very strange, because the crash occurs on 2 Windows machines and doesn't occur on the Linux-Mashine. I don't know if it is some kind of bug, or if my code is incorrect.
The method that is producing the error is here:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| public void renderPrimitives(GL gl) { gl.glMatrixMode(GL.GL_MODELVIEW); gl.glPushMatrix();
gl.glMultMatrixf(viewMatrix, 0);
gl.glEnable(GL.GL_CULL_FACE); gl.glCullFace(GL.GL_BACK);
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
float[] varray = new float[vertices.length * 3]; int k = 0; for (Vector3DVO v : vertices) { varray[k++] = v.x; varray[k++] = v.z; varray[k++] = -v.y; } FloatBuffer verticesBuffer = BufferUtil.newFloatBuffer(vertices.length * 3); verticesBuffer.put(varray); verticesBuffer.rewind(); gl.glVertexPointer(3, GL.GL_FLOAT, 0, verticesBuffer);
int[] counts = new int[faces_vertices.length]; IntBuffer[] indices = new IntBuffer[faces_vertices.length]; for (int i = 0; i < faces_vertices.length; i++) { counts[i] = faces_vertices[i].length; indices[i] = BufferUtil.newIntBuffer(faces_vertices[i].length); indices[i].put(faces_vertices[i]); indices[i].rewind(); } gl.glMultiDrawElements(GL.GL_POLYGON, counts, 0, GL.GL_UNSIGNED_INT, indices, faces_vertices.length);
gl.glDisableClientState(GL.GL_VERTEX_ARRAY);
gl.glPopMatrix(); } |
On the Ubuntu Machine (JDK 1.6, ATI Radeon X1600 with the ATI driver xorg-driver-fglrx 7.1.0-8.34) it runs normally.
On the first Windows Machine (JDK 1.6, ATI Radeon 9600 with the latest drivers 8.401.0.0) it crashes with this message:
1 2 3 4 5
| # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6936eae5, pid=1460, tid=444 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode, sharing) # Problematic frame: # C [atioglxx.dll+0x36eae5] |
On the second Windows Machine (JDK 1.6 or JDK 1.5, NVIDIA GeForce 6200SE TurboCache with 6.14.10.9371 drivers) it also crashes with a similar message:
1 2 3 4 5 6 7
| # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x695e320a, pid=3708, tid=2388 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing) # Problematic frame: # C [nvoglnt.dll+0xe320a] |
I also noticed, that this is somehow related with intensive IO - it crashes at the start of the application, when a lot of files are being read from the disk (in another thread). When I suspend the rendering thread with a Breakpoint for some seconds, until no more files are being read, the application doesn't crash. Does anybody have a clue of what is going on?
Best Regards,
Ivan