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 250881 - NetBeans may hang on start with open Maven project
Summary: NetBeans may hang on start with open Maven project
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-03 22:28 UTC by MackSix
Modified: 2015-03-06 04:11 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
VisualVM Thread Dump (26.01 KB, text/plain)
2015-03-03 22:29 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2015-03-03 22:28:50 UTC
Several times, with a Maven project that is already open when NetBeans starts. NetBeans will say it is opening the project and just hang. I can minimize the window to the task bar and open it again and then the whole window is black. 

I have to kill the process and restart.

See attached thread dump.

Product Version: NetBeans IDE Dev (Build 201503030001)
Java: 1.8.0_31; Java HotSpot(TM) 64-Bit Server VM 25.31-b07
Runtime: Java(TM) SE Runtime Environment 1.8.0_31-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 MackSix 2015-03-03 22:29:49 UTC
Created attachment 152384 [details]
VisualVM Thread Dump
Comment 2 Antonin Nebuzelsky 2015-03-04 11:50:16 UTC
org.netbeans.modules.javascript.nodejs.ui.NpmLibraries refreshing children in a thread which locks against EDT thread.

Reassigning to javascript libraries for evaluation.
Comment 3 Jan Stola 2015-03-04 13:44:37 UTC
The deadlock is between "Active Reference Queue Daemon" and "org.netbeans.spi.project.ui.support.NodeFactorySupport" threads.

Active Reference Queue Daemon thread
enters Children.PR/MUTEX at EntrySupportDefault.finalizedChildrenArray:765 and then attempts to acquire NodeFactorySupport$DelegateChildren lock at NodeFactorySupport$DelegateChildren.removeNotify:249.

On the other hand, org.netbeans.spi.project.ui.support.NodeFactorySupport thread acquires NodeFactorySupport$DelegateChildren lock at NodeFactorySupport$DelegateChildren$1.run:196 and then attempts to enter Children.MUTEX at NpmLibraries$NpmLibrariesChildren.refreshDependencies:272.

In other words, these two threads attempt to acquire two locks in an opposite order. It seems that (at least for project node's sub-nodes) one should not call setKeys() from keys().

Tomas, this is in code that you wrote recently. Could you, please, look at it and ensure that NpmLibrariesChildren.setKeys() is not called from NpmLibrariesNodeList.keys()? Thank you in advance.
Comment 4 Tomas Mysik 2015-03-04 13:51:25 UTC
Will fix it ASAP for all ImportantLibraries nodes, thanks Honzo for perfect evaluation.
Comment 5 Tomas Mysik 2015-03-05 08:36:48 UTC
Should be fixed for all libraries nodes (npm, Bower, CDNJS), I hope. Please verify, if possible.

Thanks.

http://hg.netbeans.org/web-main/rev/f8196d1759b1
Comment 6 Quality Engineering 2015-03-06 04:11:18 UTC
Integrated into 'main-silver', will be available in build *201503060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f8196d1759b1
User: Tomas Mysik <tmysik@netbeans.org>
Log: #250881 - NetBeans may hang on start with open Maven project