1

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;
  }
Talin
  • 1,397
  • 2
  • 15
  • 30
  • 1
    sounds like a bug in the Java runtime... Try to determine the single line of your code that causes the problem to happen... that might lead to a workaround/bug you can file. – nielsbot Sep 07 '12 at 22:42
  • Bus driver debug unable? – Roman C Sep 07 '12 at 22:51
  • My guess is it's a crash in native code in the OpenGL library. Did you check the implementation of `com.badlogic.gdx.graphics.Mesh.render()` to make sure it's passing in valid parameters? Looks like LWJGL is pretty lightweight and pretty much passes the parameters through to OpenGL, but I'm no expert on that. The other thing to check is that you're using the latest verion of LWJGL. – mpontillo Sep 08 '12 at 00:32
  • does OpenGL library has a log output?? i think so.. post it to us.. – thiagoh Sep 08 '12 at 15:02
  • I know exactly where in _my_ code the crash occurs - it's in a call to Mesh.render() -- which used to work, until something changed. What I need to know is how to determine where in the underlying libraries the crash is occurring. What I really need is a debugger that can catch the bus error and let me look at the stack. – Talin Sep 13 '12 at 06:17

0 Answers0