JDK-8130729 : Entire application freezes for seconds when showing tooltip for the first time
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8u40,9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2015-07-06
  • Updated: 2016-09-07
  • Resolved: 2016-09-07
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 9
9Resolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

java version "1.9.0-ea"
Java(TM) SE Runtime Environment (build 1.9.0-ea-b70)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b70, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Virtual Desktop Infrastructure, with VMware ESXi5.1 Update 3, but also tried VMware Tools for ESXi 5.5 to explore possible graphics driver issues.

Java 2D disabled with "-Dsun.java2d.d3d=false".

A DESCRIPTION OF THE PROBLEM :
As reported in JDK-8024858 and JDK-8067348, the application freezes (the ETD thread is in RUNNING NATIVE state) when a tooltip is shown for the first time.

I am re-submitting as it seems not to actually be a driver problem in this case, or at least not with the NVidia one specified. In this case, it seems to be a problem with the software rendering pipeline that is used when specifying the JVM argument "-Dsun.java2d.d3d=false".

This can be reproduced by running the "Swing" class in JDK-8067348 and hovering over the checkbox. Interestingly, this always happens on the software rendering pipeline, but does not happen under the normal Java2D pipeline, which we have disabled as the VDI infrastructure running here does not contain GPUs (graphics is CPU rendered), and it was causing graphics glitches/slowness (however, we will review this policy given this issue). 

REGRESSION.  Last worked in version 6u43

ADDITIONAL REGRESSION INFORMATION: 
JDK-7123767 seems to suggest this behaviour was introduced in 6u38, which would match our observation on the problem occurring with our update to Java 8.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run "Swing" class from JDK-8067348 with software rendering activated using: 

-Dsun.java2d.d3d=false

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No application freeze when hovering over the checkbox, shortly followed by 
ACTUAL -
Hovering over checkbox made application unresponsive. This was for about 5 seconds on my dual-monitor machine, and about half that on a single monitor machine via remote desktop.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
// As per JDK-8067348

import java.awt.Dimension; 
import java.awt.GridBagLayout; 

import javax.swing.JCheckBox; 
import javax.swing.JFrame; 
import javax.swing.JPanel; 
import javax.swing.ToolTipManager; 

public class Swing { 
private static void createAndShowGUI() { 
ToolTipManager.sharedInstance().setInitialDelay(0); 
ToolTipManager.sharedInstance().setDismissDelay(10000); 

JFrame.setDefaultLookAndFeelDecorated(true); 

JFrame frame = new JFrame("HelloWorldSwing"); 
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 

JPanel panel = new JPanel(new GridBagLayout()); 

JCheckBox checkBox = new JCheckBox("test"); 
checkBox.setToolTipText("Tooltip"); 

panel.add(checkBox); 
frame.add(panel); 

frame.setPreferredSize(new Dimension(300, 300)); 

frame.pack(); 
frame.setVisible(true); 
} 

public static void main(String[] args) { 
javax.swing.SwingUtilities.invokeLater(new Runnable() { 
public void run() { 
createAndShowGUI(); 
} 
}); 
} 
} 
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
It can be avoided by setting:

-Dsun.java2d.d3d=true

Or not specifying this at all. We will investigate this, but would need validate our applications compatibility as this was problematic in the past.


Comments
It's duplicate of JDK-8024858. To reproduce the bug, you have to have a special video card configuration. It was easily reproducible on Windows Server 2008 R2 virtual machine in VirtualBox where initialization of Win32GraphicsDevice took considerable time. The amount of time taken grew proportionally to the number of additional displays added.
07-09-2016

Issue did not occur with following 8 & 9 builds, 8 => GA b132, b5, b72. 9 => b103, b124, b133.
07-09-2016

Does it affect 8 GA?
02-09-2016

Moved to tbd_major as there are no immediate plans to address this. Marked as 8-wnf as there are no immediate plans to fix for JDK 8. - Dev may decide to fix for tbd_minor/tbd_major - If there's a customer bug filed we may revisit the 8-wnf - will not fix - and of course the OpenJDK community may decide to address this if they require. Moved to unassigned as this will not be resolved in the near term unless there is further justification and a new requirement presented.
02-09-2016

related to JDK-8024858 and JDK-8067348
22-07-2015

1. Run the attached test code (Swing.java) in Windows 7. 2. Checked this for JDK 8u40, 8u45, 8u60 ea b21, 9 ea b71. 8u40: OK 8u45: OK 8u60 ea b21: OK 9 ea b71: OK Result: This issue is not reproducible contrary to as reported by the submitter. The application behaves fine when a tooltip is shown for the first time. However, to assess this further it to the next level.
08-07-2015