This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 199469 - Deadlock on IDE startup on Windows
Summary: Deadlock on IDE startup on Windows
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Remote (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 15:56 UTC by Vladimir Kvashin
Modified: 2011-07-12 12:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full thread dump (69.72 KB, text/plain)
2011-06-16 15:56 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2011-06-16 15:56:09 UTC
Created attachment 108930 [details]
Full thread dump

I've found this when running SolStudio Windows Distribution.
But thread dump (attached) shows that the root cause is in CND.
IDE froze forever.
Comment 1 Vladimir Kvashin 2011-06-16 18:37:28 UTC
Here is the deadlock reason.
Three threads are involved.

1). "AWT-EventQueue-1" prio=6 tid=0x0707f800
waiting to lock <0x1c88d6f8> (a MakeConfigurationDescriptor)
at synchronized MakeConfigurationDescriptor.waitInitTask(MakeConfigurationDescriptor.java:284

at the same time it
locked <0x1abdf3a8>  
(java.awt.Component$AWTTreeLock - static field in Component)


2). "Open project" daemon prio=2 tid=0x05b2d400 
waiting on <0x1c88d6c8> (a org.openide.util.RequestProcessor$Task)
at the same time it
locked <0x1c88d6f8> (org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfigurationDescriptor)

The task the thread above waits for is

3). "Reading project configuraion" daemon prio=2 tid=0x4b633400 nid=0x40c waiting for monitor entry [0x0fe6e000]
   java.lang.Thread.State: BLOCKED (on object monitor)
java.awt.Component.setFont(Component.java:1800)
- waiting to lock <0x1abdf3a8> (a java.awt.Component$AWTTreeLock)
java.awt.Container.setFont(Container.java:1554)
javax.swing.JComponent.setFont(JComponent.java:2723)
javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:191)
javax.swing.plaf.basic.BasicButtonUI.installDefaults(BasicButtonUI.java:94)
com.sun.java.swing.plaf.windows.WindowsButtonUI.installDefaults(WindowsButtonUI.java:69)
javax.swing.plaf.basic.BasicButtonUI.installUI(BasicButtonUI.java:71)
javax.swing.JComponent.setUI(JComponent.java:662)
javax.swing.AbstractButton.setUI(AbstractButton.java:1782)
javax.swing.JButton.updateUI(JButton.java:128)
javax.swing.AbstractButton.init(AbstractButton.java:2149)
javax.swing.JButton.<init>(JButton.java:118)
javax.swing.JButton.<init>(JButton.java:91)
org.netbeans.modules.remote.impl.fs.ui.ConnectionNotifierDelegate.createDetails(ConnectionNotifierDelegate.java:219)
org.netbeans.modules.remote.impl.fs.ui.ConnectionNotifierDelegate.show(ConnectionNotifierDelegate.java:204)
org.netbeans.modules.remote.impl.fs.ui.ConnectionNotifierDelegate.showIfNeed(ConnectionNotifierDelegate.java:165)
- locked <0x1c8f84a8> (a org.netbeans.modules.remote.impl.fs.ui.ConnectionNotifierDelegate)
org.netbeans.modules.remote.impl.fs.ui.ConnectionNotifierDelegate.addTask(ConnectionNotifierDelegate.java:110)
- locked <0x1c8f8570> (a java.util.HashSet)
org.netbeans.modules.remote.impl.fs.ui.ConnectionNotifierImpl.addTask(ConnectionNotifierImpl.java:59)
org.netbeans.modules.remote.api.ui.ConnectionNotifier.addTask(ConnectionNotifier.java:100)
org.netbeans.modules.remote.impl.fs.RemoteFileSystem$RemoteFileSupport.addPendingFile(RemoteFileSystem.java:568)
org.netbeans.modules.remote.impl.fs.RemoteFileSystem.addPendingFile(RemoteFileSystem.java:280)
org.netbeans.modules.remote.impl.fs.RemoteDirectory.checkConnection(RemoteDirectory.java:1163)
org.netbeans.modules.remote.impl.fs.RemoteDirectory._getInputStream(RemoteDirectory.java:1110)
org.netbeans.modules.remote.impl.fs.RemotePlainFile.getInputStream(RemotePlainFile.java:129)


I believe the guilty one is the 3-rd, it should move UI-related stuff to UI thread via SwingUtilities.invokeLater.
Comment 2 Alexander Simon 2011-06-16 19:21:26 UTC
see also fix of Bug #199464 LowPerformance took 126647 ms.
Comment 3 Alexander Simon 2011-06-17 10:39:36 UTC
probably this warning is a root of problem:
java.lang.IllegalStateException: This must happen in the event thread!
	at org.openide.awt.Actions$Bridge.propertyChange(Actions.java:885)
	at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:196)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
	at javax.swing.AbstractAction.firePropertyChange(AbstractAction.java:254)
	at javax.swing.AbstractAction.setEnabled(AbstractAction.java:214)
	at org.netbeans.modules.remote.ui.HostListRootNode$AddHostAction.run(HostListRootNode.java:144)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)

Warning occurred when I add remote host.
Comment 4 Vladimir Kvashin 2011-06-17 16:40:15 UTC
fixed in cnd-main:
http://hg.netbeans.org/cnd-main/rev/5b5be820dc6e
Comment 5 Quality Engineering 2011-06-18 15:12:27 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/5b5be820dc6e
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #199469 - Deadlock on IDE startup on Windows
Comment 6 Vladimir Voskresensky 2011-06-20 15:28:23 UTC
fix is reviewed. Looks ok and safe.
Comment 7 Alexander Pepin 2011-06-20 16:10:47 UTC
Can not verify the fix as the deadlock happened once (or occasionally).
Please push the fix into 7.0.1 branch.
Comment 8 Vladimir Kvashin 2011-06-23 06:53:18 UTC
pushed into release701
http://hg.netbeans.org/releases/rev/43968e2ad8ad
Comment 9 Quality Engineering 2011-07-06 00:02:26 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/43968e2ad8ad
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #199469 - Deadlock on IDE startup on Windows
(transplanted from 5b5be820dc6e4725271cf6a3ad2a99901de07000)
Comment 10 Alexander Pepin 2011-07-12 12:37:51 UTC
It does not need verification.