United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6656412 Uninitialized libXrender.so crashes AWT
JDK-6656412 : Uninitialized libXrender.so crashes AWT

Details
Type:
Bug
Submit Date:
2008-01-29
Status:
Resolved
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2008-02-14
Component:
client-libs
OS:
linux
Sub-Component:
java.awt
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
6u10 (b12)

Related Reports
Relates:

Sub Tasks

Description
The fix for 6633275 (Need to support shaped/translucent windows) uses the libXrender.so library to query whether a given GraphicsConfiguration supports translucency effects. If Java runs on an X11 display that is not configured to use the XRENDER extension, the X server doesn't initialize it, and invoking the XRenderFindVisualFormat() function from the manually loaded libXrender.so library returns NULL. Therefore, the code using this method should carefully test the returned value, and not assume that it is always a valid pointer.

                                    

Comments
SUGGESTED FIX

$ sccs diffs -C awt_GraphicsEnv.c

------- awt_GraphicsEnv.c -------
*** /tmp/sccs.hjUVja    2008-01-29 15:29:43.000000000 +0300
--- awt_GraphicsEnv.c   2008-01-29 15:29:37.000000000 +0300
***************
*** 510,516 ****
          if (XRenderFindVisualFormat != NULL) {
              XRenderPictFormat *format = XRenderFindVisualFormat (awt_display,
                      pVITrue [i].visual);
!             if (format->type == PictTypeDirect && format->direct.alphaMask) {
                  graphicsConfigs [ind]->isTranslucencySupported = 1;
              }
          }
--- 510,518 ----
          if (XRenderFindVisualFormat != NULL) {
              XRenderPictFormat *format = XRenderFindVisualFormat (awt_display,
                      pVITrue [i].visual);
!             if (format &&
!                     format->type == PictTypeDirect && format->direct.alphaMask)
!             {
                  graphicsConfigs [ind]->isTranslucencySupported = 1;
              }
          }
                                     
2008-01-29
EVALUATION

We need to verify the return value of the XRenderFindVisualFormat() function.
                                     
2008-01-29



Hardware and Software, Engineered to Work Together