View Single Post
Old 10-30-10, 12:24 PM   #12
Registered User
Join Date: Oct 2010
Posts: 10
Default Re: 260.xx drivers break Java2D OpenGL pipeline

I have found a reliable way to reproduce the X server crash.

I downloaded the source for OpenJDK 6 and found that whenever -Dsun.java2d.opengl=true, java creates at least one pbuffer at startup in jdk/src/solaris/native/sun/java2d/opengl/GLXGraphicsConfig.c in the GLXGC_InitScratchPbuffer function. If -Dsun.java2d.opengl.fbobject=false, java will create additional pbuffers for rendering all 2D widgets.

After some experiments I have come to the conclusion that if a program has an existing pbuffer created with glXCreatePbuffer and the program exits while the pbuffer exists, there is a chance the X server will crash with the segmentation fault in my original post.

I made a small C program to demonstrate this and am attaching it. This C program creates a pbuffer with the same attributes Java uses in GLXGC_InitScratchPbuffer.

To reproduce the crash do the following:

1. Extract
2. Compile offscreen-gl.c (gcc -Wall offscreen-gl.c -lX11 -lGL -o offscreen-gl)
3. Run This script runs offscreen-gl, sleeps for 1 second, then kills it. It does this in a forever loop.

With the 260.19.06 and 260.19.12 drivers, running will eventually cause X to crash with the same segmentation fault that was in my original post. It varies how many iterations of running offscreen-gl this takes - sometimes X crashes the first time offscreen-gl is killed, sometimes it takes several iterations.

I tried this program with version 173.14.28 of the drivers also - I let it run for about 30 minutes with no X server crashes.
Attached Files
File Type: zip (1.4 KB, 128 views)
ariekenb is offline   Reply With Quote