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

Acquisition of AWT lock in Java2D Queue Flusher thread leads to a deadlock

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8
    • Fix Version/s: tbd
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • CPU:
      generic
    • OS:
      linux

      Backports

        Description

        FULL PRODUCT VERSION :
        Any release of JDK 8, JDK 7, JDK 6, where "sun.java2d.pipe.RenderQueue.lock()" uses AWT lock.

        ADDITIONAL OS VERSION INFORMATION :
        Linux OS (32-bit, 64-bit)

        A DESCRIPTION OF THE PROBLEM :
        An attempt to acquire AWT lock from the code of Runnable() instance executed by means of the method "sun.java2d.opengl.OGLRenderQueue.flushAndInvokeNow(Runnable r)" in Java2D Queue Flusher thread leads to a deadlock always. While according to the code comments, in some cases it is even required to take AWT lock in Java2D Queue Flusher thread before invocation of a certain Runnable() instance, for example the following code from "sun.java2d.opengl.OGLSurfaceData" class:

        /**
         * Note: This should only be called from the QFT under the AWT lock.
         * This method is kept separate from the initSurface() method below just
         * to keep the code a bit cleaner.
         */
        private void initSurfaceNow(int width, int height) {

        This problem was discovered during work on the bug JDK-8015730. Because of this problem currently in the file "jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c" the native function "XSync()" is called on "awt_display" without prior acquisition of AWT lock in order to not reach a deadlock, which is incorrect, since all calls to Xlib functions involving a pointer to Display should be synchronized using AWT lock.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                alitvinov Anton Litvinov
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated: