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 251095 - LauncherAction.createSubMenu causes UI freeze
Summary: LauncherAction.createSubMenu causes UI freeze
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-11 10:18 UTC by Vladimir Kvashin
Modified: 2015-08-19 15:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
full thread dump #1 (10.83 KB, patch)
2015-03-11 10:18 UTC, Vladimir Kvashin
Details | Diff
full thread dump #2 (67.99 KB, text/plain)
2015-03-11 10:19 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2015-03-11 10:18:58 UTC
Created attachment 152554 [details]
full thread dump #1

I was working on a multy-platform fs_server project.
When I right-clicked the project, there was a long UI freeze
(it was long enough for me to switch to console, call "pgrep java" and call "jstack $JAVA_PID" two times)

The EDT stack is:

"AWT-EventQueue-0" prio=10 tid=0x00007f7af00d7000 nid=0x6f2d waiting for monitor entry [0x00007f7b1974e000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.netbeans.modules.cnd.toolchain.compilerset.CompilerSetManagerAccessorImpl.getDefaultImpl(CompilerSetManagerAccessorImpl.java:122)
        - waiting to lock <0x00000007842fffb8> (a java.lang.Object)
        at org.netbeans.modules.cnd.toolchain.compilerset.CompilerSetManagerAccessorImpl.getDefault(CompilerSetManagerAccessorImpl.java:81)
        at org.netbeans.modules.cnd.api.toolchain.CompilerSetManager.get(CompilerSetManager.java:69)
        at org.netbeans.modules.cnd.makeproject.api.configurations.CompilerSet2Configuration.getCompilerSetManager(CompilerSet2Configuration.java:110)
        at org.netbeans.modules.cnd.makeproject.api.configurations.CompilerSet2Configuration.getCompilerSet(CompilerSet2Configuration.java:169)
        at org.netbeans.modules.cnd.debugger.common2.DbgActionHandlerFactory.canHandle(DbgActionHandlerFactory.java:69)
        at org.netbeans.modules.cnd.makeproject.api.ProjectActionSupport.canHandle(ProjectActionSupport.java:240)
        at org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration.hasDebugger(MakeConfiguration.java:1141)
        at org.netbeans.modules.cnd.makeproject.MakeActionProvider.isActionEnabled(MakeActionProvider.java:1404)
        at org.netbeans.modules.project.ui.actions.ActionsUtil.commandSupported(ActionsUtil.java:185)
        at org.netbeans.modules.project.ui.actions.ActionsUtil.getProjectsFromLookup(ActionsUtil.java:102)
        at org.netbeans.modules.project.ui.actions.ProjectAction$3.run(ProjectAction.java:213)
        at org.netbeans.modules.project.ui.actions.ProjectAction.refresh(ProjectAction.java:241)
        at org.netbeans.modules.project.ui.actions.LookupSensitiveAction.doRefresh(LookupSensitiveAction.java:197)
        at org.netbeans.modules.project.ui.actions.LookupSensitiveAction.getValue(LookupSensitiveAction.java:129)
        at org.netbeans.modules.project.ui.actions.ProjectAction.getValue(ProjectAction.java:75)
        at javax.swing.AbstractButton.setMnemonicFromAction(AbstractButton.java:1256)
        at javax.swing.AbstractButton.configurePropertiesFromAction(AbstractButton.java:1160)
        at javax.swing.JMenuItem.configurePropertiesFromAction(JMenuItem.java:376)
        at javax.swing.AbstractButton.setAction(AbstractButton.java:1107)
        at javax.swing.JMenu.add(JMenu.java:630)
        at org.netbeans.modules.cnd.makeproject.launchers.actions.LauncherAction.createSubMenu(LauncherAction.java:131)
        at org.netbeans.modules.cnd.makeproject.launchers.actions.LauncherAction.createMenuItem(LauncherAction.java:86)
        at org.netbeans.modules.cnd.makeproject.launchers.actions.LauncherAction.getPopupPresenter(LauncherAction.java:76)
        at org.openide.util.Utilities.actionsToPopup(Utilities.java:1729)
        at org.openide.util.Utilities.actionsToPopup(Utilities.java:1815)
        at org.openide.explorer.view.TreeView.createPopup(TreeView.java:1058)
        at org.openide.explorer.view.TreeView$PopupAdapter.showPopup(TreeView.java:1555)
        at org.openide.awt.MouseUtils$PopupMouseAdapter.maybePopup(MouseUtils.java:189)


Full stacks are in attachments
Comment 1 Vladimir Kvashin 2015-03-11 10:19:44 UTC
Created attachment 152555 [details]
full thread dump #2
Comment 2 ilia 2015-08-19 15:17:16 UTC
Steps to reproduce (I'm not sure if the steps 3 and 4 are needed, i used this workflow for easier debugging process):
  1) Create a remote project with existing sources
     Use a host with very slow FS, or mimic it by inserting a breakpoint to
     CompilerSetManagerAccessorImpl.java:101 (setManagers(), CompilerSetPreferences.saveToDisk(impl))
  2) Add some launchers to this project
  2) Services | Remove Host (for the created project)
  3) Services | Add New Host
  ------------------
     AddHostAction thread freezes with MASTER_LOCK
  ------------------
  4) Right click on the project
  ------------------
     AWT thread freezes with stack from Comment #1 (Waiting for MASTER_LOCK)
  ------------------ 
  UI is frozen until changes are saved (CompilerSetPreferences.saveToDisk)
Comment 3 ilia 2015-08-19 15:26:24 UTC
Note: Expanding the "Debug" menu on the top of the IDE will cause all this work (checking if isActionEnabled is true) is also done, but in the separate thread "LookupSensitiveAction". Thus, UI isn't frozen in this case.