JDK-8026356 : [macosx] Found one Java-level deadlock:"AWT-EventQueue-0" && main
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • CPU: generic
  • Submitted: 2013-10-11
  • Updated: 2015-10-02
  • Resolved: 2013-10-17
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.
8 b115Fixed
Related Reports
Relates :  
Tested jdk 8 b110:
lwawt takes a locks in the wrong order, but this particular issue can be fixed in the setFont(), because synchronisation on this is not necessary there.

Testcase attached:

Found one Java-level deadlock:
  waiting to lock monitor 0x00007fa355092108 (object 0x0000000700241b68, a LabelRepaint),
  which is held by "main"
  waiting to lock monitor 0x00007fa354806328 (object 0x0000000700010520, a java.awt.Component$AWTTreeLock),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
	at java.awt.Component.setFont(Component.java:1888) <<<<<<<<<<<<<<<<<<<<<<<<<<<<NOT NECESSARY???
	- waiting to lock <0x0000000700241b68> (a LabelRepaint)
	- locked <0x0000000700010520> (a java.awt.Component$AWTTreeLock)
	at LabelRepaint.test(LabelRepaint.java:52)
	at LabelRepaint.paint(LabelRepaint.java:36)
	at sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
	at sun.lwawt.LWRepaintArea.paintComponent(LWRepaintArea.java:59)
	at sun.awt.RepaintArea.paint(RepaintArea.java:240)
	at sun.lwawt.LWComponentPeer.handleJavaPaintEvent(LWComponentPeer.java:1316)
	at sun.lwawt.LWComponentPeer.handleEvent(LWComponentPeer.ja
	at sun.lwawt.LWLabelPeer.setText(LWLabelPeer.java:60)
	- waiting to lock <0x0000000700010520> (a java.awt.Component$AWTTreeLock)
	at java.awt.Label.setText(Label.java:253)
	- locked <0x0000000700241b68> (a LabelRepaint)
	at LabelRepaint.test(LabelRepaint.java:44)
	at LabelRepaint.main(LabelRepaint.java:18)

Found 1 deadlock.
[SQE] Risk: low to test the fix run the test/java/awt/Paint/LabelRepaint.java a lot of times. [/SQE]