JDK-8019923 : Acquisition of AWT lock in Java2D Queue Flusher thread leads to a deadlock
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: generic
  • Submitted: 2013-07-04
  • Updated: 2021-07-13
Related Reports
Relates :  
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.
Comments
- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014