JDK-6525997 : OGL: VM crash when drawing a general path on screen and repainting it a few times, Win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-02-16
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u4Fixed 7 b10Fixed
Related Reports
Relates :  
Description
Run the attached test with JDK7-b08 2D PIT build (with OGL flag turned on) on a WinXP machine with ATI Radeon 9600 series. A general path should appear in blue color. The actual behavior is as follows -

1. Frame appears blank. General Path is not appearing.
2. Maximize the frame and move the mouse horizontally a few times, within the frame. 
You would see a VM crash. 

This is not reproducible on JDK7-b07. This is not reproducible on JDK6. Not reproducible on the default pipeline with the PIT build. Hence this seems to introduced in JDK-b08 PIT. 

The testcase is creating the offscreen image everytime the canvas is repainted, which is not a right thing to do but it should not crash the VM. 

I have attached the testcase and the log file having the crash dump.

Comments
EVALUATION It looks like part of the fix for 5066318 tripped over yet another ATI driver bug (which is ironic because that fix was supposed to help workaround some other ATI driver bugs). One part of that fix was to use the WGL_ARB_make_current_read extension (and the wglMakeContextCurrentARB() method) for making contexts current for a given src/dst pair. It appears that on ATI drivers under certain circumstances, if srcHDC==dstHDC, this method will cause a crash in ATI's drivers. Ugh. I don't fully understand why this crash occurs sometimes but not others (e.g. I can run SwingSet2 or Java2Demo just fine and never experience a crash, but testcases like the one attached here or test/sun/java2d/OpenGL/GradientPaints.java crash reliably everytime). Fortunately we can workaround the bug quite easily. We only need to use the wglMakeContextCurrentARB() method when the two surfaces are different; when they are the same surface, we can simply use the old wglMakeCurrent() method to make the context current to the single destination surface. I've verified that this "fix" works around the problem at hand, and now there are no more crashes for either -Dsun.java2d.opengl.fbobject=true or fbobject=false.
27-02-2007