Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8239819

XToolkit: Misread of screen information memory

XMLWordPrintable

    • b19
    • generic
    • linux

        The XAWT for some native structures uses special java wrappers. These wrappers have to be created on top of the native pointer and provide access to the native fields directly w/o JNI methods.

        We have incorrect usage of such wrapper in the XToolkit class:
        Toolkit creates AwtScreenData wrapper on top of the XToolkit.getDefaultScreenData()
        https://hg.openjdk.java.net/jdk/jdk/file/321b6fbe6815/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java#l344

        But unfortunately, this native method returns the wrong pointer to getDefaultConfig():
        https://hg.openjdk.java.net/jdk/jdk/file/321b6fbe6815/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c#l134

        getScreenData() should be used instead of getDefaultConfig() since native data for default configuration is bigger than screen data we most of the time read some "random" information about visual info.

              serb Sergey Bylokhov
              serb Sergey Bylokhov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: