JDK-7164951 : Test api/java_awt/GraphicsDevice/indexTGF.html#SetDisplayMode hangs on Ubuntu 11.04 due to deadlock
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_ubuntu
  • CPU: x86
  • Submitted: 2012-04-27
  • Updated: 2013-09-23
  • Resolved: 2013-09-23
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 8
8Resolved
Related Reports
Duplicate :  
Description
This JCK test hangs since b16:
api/java_awt/GraphicsDevice/indexTGF.html#SetDisplayMode

With deadlock:
Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
  waiting for ownable synchronizer 0x00000000db65c370, (a java.util.concurrent.locks.ReentrantLock$NonfairSync),
  which is held by "AWT-XAWT"
"AWT-XAWT":
  waiting to lock monitor 0x00000000015c8570 (object 0x00000000db6882a8, a sun.awt.X11GraphicsDevice),
  which is held by "AWT-EventQueue-0"

or 

Found one Java-level deadlock:
=============================
"AWT-XAWT":
  waiting to lock monitor 0x000000000220e748 (object 0x00000000eb480c38, a sun.a
wt.X11GraphicsDevice),
  which is held by "main"
"main":
  waiting for ownable synchronizer 0x00000000eb455c08, (a java.util.concurrent.l
ocks.ReentrantLock$NonfairSync),
  which is held by "AWT-XAWT"

Dump file attached.

Comments
Anyway it is a deadlock. We a dispatching events in XToolkit with awt lock. And 2d code uses X11GraphicsDevice as a monitor. Trying to process display changed notification we are taken 1. awt lock 2. X11GraphicsDevice monitor. Trying to set a full screen we are taken the locks in reverse order. It would be better to notify DisplayChangedListeners on EDT as it has done in WToolkit. See a comment for Win32GraphicsEnviroment.displayChanged().
23-01-2013

EVALUATION Cannot reproduce the problem with jdk 1.8.0 b15.
04-05-2012

EVALUATION I can reproduce the problem on my Ubuntu 11.10 with b37.
04-05-2012