Patch that sort out OpenGL-related issue in IcedTea6 HEAD (was: Possible regression between IcedTea6-1.8 and IcedTea6-1.9)

Dr Andrew John Hughes ahughes at redhat.com
Tue Aug 31 09:07:56 PDT 2010


On 16:15 Tue 31 Aug     , Dr Andrew John Hughes wrote:
> On 18:12 Mon 30 Aug     , Pavel Tisnovsky wrote:
> > Hi all,
> > 
> > can anybody please review simple patch which in the end ensures that
> > method glGetString(GL_VENDOR) etc. is called only when rendering context
> > is properly configured. When glGetString() is called for uninitialized
> > rendering context, it is possible that application got SIGSEGV because
> > OpenGL standard does not specify correct behaviour in this case.
> > 
> 
> As this patch is a backport of:
> 
> 6755274: 6u10b33 2d tests fails on sles10x64 with jvm crash
> Reviewed-by: campbell
> http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/452c58b2f53
> 
> can you use a hg export of this changeset rather than a fresh patch,
> and include it as patches/openjdk/6755274-glgetstring-crash.patch?
> 
> We're then also covered for Windows, should anyone ever build IcedTea there ;-)
> 
> Please commit to HEAD and 1.9 with these changes.
> 
> > The patch is based on actual OpenJDK7 sources and it's behaviour can be
> > tested by this simple test:
> > 
> > import javax.swing.JFrame;
> > 
> > public class Test extends JFrame {
> >     public Test() {
> >         System.out.println("Nothing happens");
> >     }
> > 
> >     public static void main(String[] args)
> >     {
> >         Test t = new Test();
> >         System.out.println("Test Passed.");
> >     }
> > }
> > 
> > (must be run with -Dsun.java2d.opengl=True option)
> > 
> 
> Can you include this as JTreg test in a separate patch? 
> 
> > 
> > Cheers
> > Pavel
> > 
> > PS: if anybody is interested whether his OpenGL implementation
> > segfaulted (RHEL5 and its Mesa 6.5.1 case, for example), this C test can
> > be useful:
> > 
> > #include <GL/gl.h>
> > #include <stdlib.h>
> > #include <stdio.h>
> > 
> > int main(void)
> > {
> >     printf("%x\n", glXGetCurrentContext());
> >     glGetString(GL_VENDOR);
> >     return 0;
> > }
> > 
> > (must be compiled with -lGL and -lX11 options)
> 
> 
> > --- openjdk/jdk/src/solaris/classes/sun/java2d/opengl/GLXGraphicsConfig.java.old	2010-08-30 11:47:11.000000000 +0200
> > --- openjdk/jdk/src/solaris/classes/sun/java2d/opengl/GLXGraphicsConfig.java	2010-08-30 11:47:11.000000000 +0200
> > @@ -120,12 +120,15 @@
> >                  new GLXGetConfigInfo(device.getScreen(), visualnum);
> >              rq.flushAndInvokeNow(action);
> >              cfginfo = action.getConfigInfo();
> > -            OGLContext.setScratchSurface(cfginfo);
> > -            rq.flushAndInvokeNow(new Runnable() {
> > -                public void run() {
> > -                    ids[0] = OGLContext.getOGLIdString();
> > -                }
> > -            });
> > +            // System.out.println("GLXGetConfigInfo: " + cfginfo);
> > +            if (cfginfo != 0L) {
> > +                OGLContext.setScratchSurface(cfginfo);
> > +                rq.flushAndInvokeNow(new Runnable() {
> > +                    public void run() {
> > +                        ids[0] = OGLContext.getOGLIdString();
> > +                    }
> > +                });
> > +            }
> >          } finally {
> >              rq.unlock();
> >          }
> 
> Thanks,
> -- 
> Andrew :)
> 
> Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
> 
> Support Free Java!
> Contribute to GNU Classpath and the OpenJDK
> http://www.gnu.org/software/classpath
> http://openjdk.java.net
> PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
> Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8

Likewise,

changeset:   995:0c856354b669
user:        tdv
date:        Thu Feb 26 13:38:38 2009 -0800
summary:     6791612: OGLBat tests are failed in jdk 7 b42
http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/0c856354b669

should be exported and replace opengl-jni-fix.patch with
patches/openjdk/6791612-opengl-jni-fix.patch
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8



More information about the distro-pkg-dev mailing list