---- Reported by gfxadmin 2006-06-13 17:10:35 ---- When compiled on Solaris AMD64, JOGL often crashes with a seg fault on our Solaris 10 AMD64 box. This is running with a fairly recent Nvidia framebuffer and the latest and greatest Nvidia driver (it was crashing similarly with an older Nvidia driver before upgrading). The entire VM crashes almost immediately when a bad call is encountered. Other programs run with no problems at all. It seems to happen immediately in the native code dispatch call. Examples of problem programs include anything with a PBuffer, shaders, or that calls glXSwapIntervalSGI (setSwapInterval()). I have listed 3 typical stack traces below. To reproduce, just run example programs that use any of these calls (most of them). == Travis Typical stack traces (this is what the VM leaves behind): Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j com.sun.opengl.impl.x11.GLXExtImpl.dispatch_glXSwapIntervalSGI0(IJ)I+0 j com.sun.opengl.impl.x11.GLXExtImpl.glXSwapIntervalSGI(I)I+30 j com.sun.opengl.impl.x11.X11GLContext.setSwapInterval(I)V+22 j com.sun.opengl.impl.GLImpl.setSwapInterval(I)V+5 j demos.gears.Gears.init(Ljavax/media/opengl/GLAutoDrawable;)V+40 j com.sun.opengl.impl.GLDrawableHelper.init(Ljavax/media/opengl/GLAutoDrawable;)V+29 j javax.media.opengl.GLCanvas$InitAction.run()V+11 j com.sun.opengl.impl.GLDrawableHelper.invokeGL(Ljavax/media/opengl/GLDrawable;Ljavax/media/opengl/GLContext;Ljava/lang/Runnable;Ljava/lang/Runnable;)V+370 j javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(Ljava/lang/Runnable;Ljava/lang/Runnable;)V+36 j javax.media.opengl.GLCanvas.display()V+9 j javax.media.opengl.GLCanvas.paint(Ljava/awt/Graphics;)V+1 j sun.awt.RepaintArea.paint(Ljava/lang/Object;Z)V+324 j sun.awt.motif.MComponentPeer.handleEvent(Ljava/awt/AWTEvent;)V+68 j java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+552 j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2 j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+41 j java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+169 j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26 j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 j java.awt.EventDispatchThread.run()V+9 v ~StubRoutines::call_stub Another: Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j com.sun.opengl.impl.x11.GLX.dispatch_glXChooseFBConfig1(JILjava/lang/Object;I Ljava/lang/Object;IJ)[Ljava/nio/ByteBuffer;+0 j com.sun.opengl.impl.x11.GLX.glXChooseFBConfig(JI[II[II)[Lcom/sun/opengl/impl/ x11/GLXFBConfig;+151 j com.sun.opengl.impl.x11.X11PbufferGLDrawable.createPbuffer(J)V+90 j com.sun.opengl.impl.x11.X11PbufferGLDrawable.<init>(Ljavax/media/opengl/GLCap abilities;II)V+163 j com.sun.opengl.impl.x11.X11GLDrawableFactory$3.run()V+16 j com.sun.opengl.impl.x11.X11GLDrawableFactory.maybeDoSingleThreadedWorkaround( Ljava/lang/Runnable;)V+20 j com.sun.opengl.impl.x11.X11GLDrawableFactory.createGLPbuffer(Ljavax/media/ope ngl/GLCapabilities;Ljavax/media/opengl/GLCapabilitiesChooser;IILjavax/media/open gl/GLContext;)Ljavax/media/opengl/GLPbuffer;+47 j javax.media.opengl.GLJPanel.initialize()V+105 j javax.media.opengl.GLJPanel.paintComponent(Ljava/awt/Graphics;)V+8 j demos.jgears.JGears.paintComponent(Ljava/awt/Graphics;)V+2 j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+257 j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+523 j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+289 j javax.swing.JComponent.paintWithOffscreenBuffer(Ljavax/swing/JComponent;Ljava /awt/Graphics;IIIILjava/awt/Image;)V+165 j javax.swing.JComponent.paintDoubleBuffered(Ljavax/swing/JComponent;Ljava/awt/ Component;Ljava/awt/Graphics;IIII)Z+131 j javax.swing.JComponent._paintImmediately(IIII)V+711 And one last one: Instructions: (pc=0xffffffffe05b6670) 0xffffffffe05b6660: [error occurred during error reporting, step 100, id 0xb] Stack: [0xfffffd7fdee00000,0xfffffd7fdeffe000), sp=0xfffffd7fdeffd2b8, free sp ace=2036k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C 0xffffffffe05b6670 [error occurred during error reporting, step 120, id 0xb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j com.sun.opengl.impl.GLImpl.dispatch_glGenProgramsARB1(ILjava/lang/Object;IJ)V +0 j com.sun.opengl.impl.GLImpl.glGenProgramsARB(I[II)V+97 j demos.vertexProgRefract.VertexProgRefract.init(Ljavax/media/opengl/GLAutoDraw able;)V+144 j com.sun.opengl.impl.GLDrawableHelper.init(Ljavax/media/opengl/GLAutoDrawable; )V+29 j javax.media.opengl.GLCanvas$InitAction.run()V+11 j com.sun.opengl.impl.GLDrawableHelper.invokeGL(Ljavax/media/opengl/GLDrawable; Ljavax/media/opengl/GLContext;Ljava/lang/Runnable;Ljava/lang/Runnable;)V+370 j javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(Ljava/lang/Runnab le;Ljava/lang/Runnable;)V+36 j javax.media.opengl.GLCanvas.display()V+9 j javax.media.opengl.GLCanvas.paint(Ljava/awt/Graphics;)V+1 j sun.awt.RepaintArea.paint(Ljava/lang/Object;Z)V+324 j sun.awt.motif.MComponentPeer.handleEvent(Ljava/awt/AWTEvent;)V+68 ---- Additional Comments From kbr 2007-04-20 16:01:22 ---- The implementation of glXGetProcAddressARB on Solaris/AMD64 had a similar problem to that seen on Linux/AMD64 distributions: internally the return value is being cast to a 32-bit value and then sign-extended back to 64 bits, causing the high half of its function pointer return values to be lost. Worked around by using dlsym() for lookup on this OS as well as on Linux/AMD64. Fix will be present in the JOGL 1.1.0 final release. ---- Additional Comments From kbr 2007-04-20 18:35:06 ---- The above evaluation is incorrect. It turns out that the autogenerated GLX_JNI.c was not receiving a prototype for glXGetProcAddressARB and so was receiving the implicit one returning an int, which is obviously wrong on 64-bit architectures. Re-fixed this bug by providing a prototype; removed the workaround in X11GLDrawableFactory. --- Bug imported by sgothel@jausoft.com 2010-03-24 07:48 EDT --- This bug was previously known as _bug_ 226 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=226