I’m experiencing the following JVM crash on a Solaris 9 box using jogl 1.1b10 and jdk 1.5.0_02.
C [libX11.so.4+0x387e4] XVisualIDFromVisual+0x4
C [libjogl.so+0x5eb84] Java_net_java_games_jogl_impl_JAWT_1DrawingSurface_GetDrawingSurfaceInfo0+0x7c
net.java.games.jogl.impl.JAWT_DrawingSurface.GetDrawingSurfaceInfo0(Ljava/nio/Buffer;)Ljava/nio/ByteBuffer;+0
net.java.games.jogl.impl.JAWT_DrawingSurface.GetDrawingSurfaceInfo0(Ljava/nio/Buffer;)Ljava/nio/ByteBuffer;+0
net.java.games.jogl.impl.JAWT_DrawingSurface.GetDrawingSurfaceInfo()Lnet/java/games/jogl/impl/JAWT_DrawingSurfaceInfo;+5
net.java.games.jogl.impl.x11.X11OnscreenGLContext.lockSurface()Z+104
net.java.games.jogl.impl.x11.X11OnscreenGLContext.makeCurrent(Ljava/lang/Runnable;)Z+1
net.java.games.jogl.impl.GLContext.invokeGL(Ljava/lang/Runnable;ZLjava/lang/Runnable;)V+246
net.java.games.jogl.GLCanvas$2.run()V+19
java.awt.event.InvocationEvent.dispatch()V+47
java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26
java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+200
java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26
java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
java.awt.EventDispatchThread.run()V+9
The code that is causing the crash is the setSize call in the following bit of code
JFrame f = new JFrame();
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas( new GLCapabilities() );
final GLDrawableHolder drawableHolder = new GLDrawableHolder( canvas, new GLDrawableDecorator( canvas ) );
Component component = drawableHolder.getComponent();
GLDrawable drawable = drawableHolder.getGLDrawable();
Listener listener = new Listener();
drawable.addGLEventListener( listener );
component.addMouseListener( listener );
component.addMouseMotionListener( listener );
component.setSize( 600, 600 );
Container pane = f.getContentPane();
pane.setLayout( new BorderLayout() );
pane.add( component );
f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
f.pack();
f.invalidate();
f.setVisible( true );
I’ve reduced my code to a little program that reproduces the error (http://pepijn.fab4.be/jogl_bug.zip). This crash does not happen every time I launch the application, so I suspect there’s a race condition somewhere.