Patch that sort out OpenGL-related issue in IcedTea6 HEAD

Pavel Tisnovsky ptisnovs at redhat.com
Wed Sep 1 07:37:23 PDT 2010


Dr Andrew John Hughes wrote:
> 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?

Done for IcedTea6 HEAD and IcedTea6-1.9.

Results of regression tests are now much better, as you can check on the
page http://torment.usersys.redhat.com/openjdk/jtreg_hist_10.html
(I mean last "almost green" column :-)

>>
>> 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? 

Could you please review the patch which is stored in attachment.

>>
>>> 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

Done for IcedTea6 HEAD and IcedTea6-1.9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icedtea-jtreg-OpenGLContextInit.patch
Type: text/x-patch
Size: 1738 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20100901/6e4cae2d/icedtea-jtreg-OpenGLContextInit.patch 


More information about the distro-pkg-dev mailing list