I recently started getting a bus error in some code that I haven't run in a while, and I'm not sure what changed, but I'd like to be able to pin down the cause. Unfortunately, I'm used to debugging errors in the Eclipse debugger, but that won't help in this case since the program simply terminates.
Java information:
Exception type: Bus Error (0xa) at pc=164c38674
Java VM: Java HotSpot(TM) 64-Bit Server VM (20.10-b01-428 mixed mode macosx-amd64)
Current thread (10d8bb800): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=547360768, stack(120901000,120a01000)]
Stack: [120901000,120a01000]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.lwjgl.opengl.GL11.nglDrawArrays(IIIJ)V+0
J com.badlogic.gdx.graphics.Mesh.render(Lcom/badlogic/gdx/graphics/glutils/ShaderProgram;III)V
j org.viridia.fta.engine.particles.QuadSpriteBatchRenderer.flush()V+140
J org.viridia.fta.engine.particles.QuadSpriteAppearance.draw(Lorg/viridia/fta/engine/particles/ParticleSystem;Lcom/badlogic/gdx/math/Matrix4;Lcom/badlogic/gdx/math/Matrix4;[Lorg/viridia/fta/engine/particles/Particle;II)V
j org.viridia.fta.engine.particles.ParticleEmitter.render(Lorg/viridia/fta/engine/particles/ParticleSystem;Lcom/badlogic/gdx/math/Matrix4;Lcom/badlogic/gdx/math/Matrix4;)V+16
j org.viridia.fta.engine.particles.ParticleSystem.render(Lcom/badlogic/gdx/math/Matrix4;Lcom/badlogic/gdx/math/Matrix4;)V+29
j org.viridia.tiles.ui.TileMapEditor.render()V+474
j com.badlogic.gdx.backends.lwjgl.LwjglAWTCanvas.render()V+190
j com.badlogic.gdx.backends.lwjgl.LwjglAWTCanvas$1.paintGL()V+4
j org.lwjgl.opengl.AWTGLCanvas.paint(Ljava/awt/Graphics;)V+172
j org.lwjgl.opengl.AWTGLCanvas.update(Ljava/awt/Graphics;)V+2
j sun.awt.RepaintArea.updateComponent(Ljava/awt/Component;Ljava/awt/Graphics;)V+6
j sun.awt.RepaintArea.paint(Ljava/lang/Object;Z)V+305
(etc...)
One thing that did change recently is that the OS X "Software Update" service recently updated the default JVM. However, that might not be the cause - I tried running under different JVMs in Eclipse and got the same problem.
As you can see from the stack dump, I'm using Light Weight Java Games Library, which is getting called via libgdx. My own code isn't doing anything particularly special here, as far as I can tell, and it worked fine the last time I tried it (about a month ago):
public void flush() {
if (vertexCount > 0 && shader != null) {
mesh.setVertices(vertices, 0, vertexCount);
shader.begin();
Gdx.gl20.glEnable(GL20.GL_BLEND);
Gdx.gl20.glDepthMask(false);
Gdx.gl20.glEnable(GL20.GL_DEPTH_TEST);
if (texture != null && hasTexture) {
texture.bind(0);
shader.setUniformi("uTexture0", 0);
}
shader.setUniformMatrix("uViewXForm", view);
shader.setUniformMatrix("uProjXForm", proj);
mesh.render(shader, GL20.GL_TRIANGLES, 0, vertexCount);
shader.end();
Gdx.gl20.glDepthMask(true);
}
vertexCount = 0;
}