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 256017 - NB freeze after start
Summary: NB freeze after start
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.2
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 256077 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-10-19 12:29 UTC by legitalk
Modified: 2016-02-04 13:24 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (34.85 KB, text/plain)
2015-10-19 12:29 UTC, legitalk
Details
Thread dump, when NB was frozen. (14.41 KB, text/plain)
2015-10-20 13:41 UTC, legitalk
Details
nbproject of two opened projects (3.33 KB, application/x-zip-compressed)
2015-10-22 09:21 UTC, legitalk
Details
Thread dump, when NB was frozen. (47.45 KB, text/plain)
2015-10-29 09:23 UTC, legitalk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description legitalk 2015-10-19 12:29:18 UTC
Product Version = NetBeans IDE Dev (Build 201510180002)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_60
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.60-b23

Reproducibility: Happens every time

Today I installed latest nightly build; before I had 201510160002, and it was working without problem.

After I launch NB, it starts, and is opening projects. And then, without doing nothing, it just freeze, and I can do nothing, even not close NB. To processor has for netbeans64.exe max load, and I can only end the process
Comment 1 legitalk 2015-10-19 12:29:21 UTC
Created attachment 156800 [details]
IDE log
Comment 2 Antonin Nebuzelsky 2015-10-19 15:21:24 UTC
Can you create and attach a thread dump of the frozen NB instance?

http://wiki.netbeans.org/GenerateThreadDump
Comment 3 Antonin Nebuzelsky 2015-10-20 09:57:29 UTC
Reopen if this happens again and you can provide the thread dump.
Comment 4 legitalk 2015-10-20 10:01:32 UTC
Right now its frozen, and it became unfrozen after many minutes, and showed Java error - Interrupted attempt to acquire write lock.

Then I tried to send bug report, but it freeze again. If I success with this, I will attach here the bug ID.
Comment 5 Jiri Kovalsky 2015-10-20 10:21:21 UTC
(In reply to legitalk from comment #4)

> If I success with this, I will attach here the bug ID.

Plus reopen the bug again. Thanks!
Comment 6 Antonin Nebuzelsky 2015-10-20 10:25:10 UTC
(In reply to legitalk from comment #4)
> Right now its frozen, and it became unfrozen after many minutes, and showed
> Java error - Interrupted attempt to acquire write lock.
> 
> Then I tried to send bug report, but it freeze again. If I success with
> this, I will attach here the bug ID.

Another bug report will not help. Just take the thread dump as requested above and attach to this issue.
Comment 7 legitalk 2015-10-20 10:48:41 UTC
I tried this, but there is no console windows. And also there is no nb.exe...

Press Ctrl-Break in the command console you used to start the IDE
    If the console isn't opened (in case you started the IDE using the default desktop icon): 

        launch the IDE using a console window
        (invoke Command Prompt, go to {netbeans-install-dir}/bin and type nb.exe)
        configure the desktop shortcut to launch the nb.exe instead of netbeans.exe (default)
        NB7 and later - there is no nb.exe, just run netbeans.exe from console. If NB is started by shortcut use "--console new" option to open console (netbeans.exe --console new). 

    The thread dump is printed into the command console. Just assure that the console have the line buffer long enough so that the whole thread dump fits in.
Comment 8 Jiri Kovalsky 2015-10-20 10:53:23 UTC
Then simply use VisualVM [1]. It's very easy.

[1] https://visualvm.java.net
Comment 9 legitalk 2015-10-20 13:41:50 UTC
Created attachment 156838 [details]
Thread dump, when NB was frozen.
Comment 10 Jiri Kovalsky 2015-10-21 20:54:04 UTC
This thread dump is cut in the middle and it is also wrapped which makes reading very difficult. Can you please generate another one which would be correct? Thanks!
Comment 11 legitalk 2015-10-21 21:01:05 UTC
I setted up settings of cmd to 999 memory lines and etc, everything to maximum as possible and copied everything what was there.
Comment 12 legitalk 2015-10-21 21:06:21 UTC
Also btw. I found out how to solve this bug. NB was not usable anymore. When launched and it was opening projects, everytime it freeze in few minutes.

But I deleted all nbproject folders in each project and then launched it again and there was no project. I created again all projects and there restart IDE a d the problem was fixed...
Comment 13 Jiri Kovalsky 2015-10-21 21:57:26 UTC
What a shame you didn't backup those project directories. We cannot reproduce it so I am marking this bug as WORKSFORME. Next time please really use VisualVM to generate the thread dump. Thanks!
Comment 14 legitalk 2015-10-22 09:18:23 UTC
Don't worry, yesterday this solution solved the bug. But today its happening again :-)

So what you want from me now? Upload of project netbeans directories?
Comment 15 legitalk 2015-10-22 09:21:06 UTC
Created attachment 156898 [details]
nbproject of two opened projects

This two project I have since yesterday, and it was working; today morning its happening again, and when NB is opening that projects on start up, it freeze...
Comment 16 Jiri Kovalsky 2015-10-22 11:18:56 UTC
Great, can you please also install the VisualVM, generate the Full Thread Dump with it and attach it here? Thanks!
Comment 17 legitalk 2015-10-27 09:56:22 UTC
When I used VisualVM, this is happening:
- NB is running much more slowly
- the problem is not occuring

When I dont use VisualVM, the problem is happening... So?
Comment 18 legitalk 2015-10-27 09:56:45 UTC
*** Bug 256077 has been marked as a duplicate of this bug. ***
Comment 19 legitalk 2015-10-29 09:23:40 UTC
Created attachment 157035 [details]
Thread dump, when NB was frozen.

Ok, so finally a did it. The problem was, when NB and VisualVM were running together, NB was running approx. 50% slower... So I started only NB, there were 3 projects opening, after couple minutes it was frozen, as always, so NB was again as always not usable.

Then I launch VisualVM, and do thread dump. Hope now it helps you somehow.
Comment 20 legitalk 2015-10-29 09:24:51 UTC
And as I said before, when NB and VisualVM were running together, this bug wont happend...
Comment 21 Martin Entlicher 2015-10-29 15:58:41 UTC
I went through the changes between build #201510160002 and build #201510180002 and did not find anything that seems to be relevant to this deadlock.
Can you please check build #201510170002 at http://bits.netbeans.org/download/trunk/nightly/2015-10-17_00-02-28/ ?
Also, can you please check the latest trunk build, just for the case that build #201510180002 happens to be corrupted for some reason?

Also, is the 8.1RC2 working fine for you?
http://download.netbeans.org/netbeans/8.1/rc2/

Thank you.
Comment 22 legitalk 2015-10-29 16:02:08 UTC
Its still happening in the latest build #201510290002. And now its happening also in #201510160002, so I really dont know, when it started :-/
Comment 23 Martin Entlicher 2015-10-29 17:45:47 UTC
In thread "AWT-EventQueue-0" #21, DefaultMutexImplementation read mutex is acquired, PHP project is trying to get the list of problems for the node's display name and thus it starts lookup for the providers. This lookup waits for a notification from another thread (most probably "org.netbeans.spi.project.ui.support.NodeFactorySupport" #78)

Thread "org.netbeans.spi.project.ui.support.NodeFactorySupport" #78 is collecting a lookup of all important files (ImportantFilesImpl.getAllInstances()) and as a result of such collection, ImportantFilesImpl.resultChanged() is called. As a response to this lookup change, ImportantFiles$ImportantFilesChildren calls setKeys(), which tries to acquire write mutex from DefaultMutexImplementation. But this can not be accomplished, since read mutex is already held by "AWT-EventQueue-0".
Comment 24 Martin Entlicher 2015-10-30 15:23:38 UTC
Moving to PHP for evaluation.
Perhaps ImportantFilesImpl could be adjusted to e.g. ignore the lookup changes during collection of the instances?
Unfortunately, LazyLookupProviders set the lookup content on query.
Comment 25 Tomas Mysik 2015-11-02 07:00:48 UTC
@jhavlin: Jardo, isn't it the same as issue #253732? Thanks.
Comment 26 Jaroslav Havlin 2015-11-02 12:26:22 UTC
(In reply to Tomas Mysik from comment #25)
> @jhavlin: Jardo, isn't it the same as issue #253732? Thanks.
Unfortunately, I wouldn't say so. It may be related to that issue, but I think it should be fixed separately.
(Reporter uses build 201510180002, which should already contain fix for the issue.)

> Perhaps ImportantFilesImpl could be adjusted to e.g. ignore the lookup
> changes during collection of the instances?
This would be nice.
Comment 27 legitalk 2015-11-02 13:16:32 UTC
In the latest nightly build #201511020002 (x64) it is still present, and NB freeze during opening projects (I have 2 projects in projects windows).

I just downloaded and installed the oldest available nightly build #201510030002 (x64), and there it is also happening.

Then I downloaded and installed 8.1rc2 (x64), and also copied AppData\Roaming\NetBeans\dev to \AppData\Roaming\NetBeans\8.1rc2 and the same with \AppData\Local\NetBeans\Cache\dev to \AppData\Local\NetBeans\Cache\8.1rc2, and it is still happening. So now I am thinking, maybe there is some problems with stored appdata files.

I finally downloaded and installed 8.0.2 (there was no choice of x64 or x86), where for sure I didnt have this problem with NB freezing after start some weeks ago, when I was using this version, and here I also copied that all AppData files, and here to problem doesnt exists.

So the problem is not with my AppData files, and it should be something like is mentioned in comment #23 by Martin Entlicher.

So the problem is occured in 8.1rc2 and also in #201510030002, but its not in 8.0.2.

Hope this analysis helps you. Thanks.
Comment 28 Tomas Mysik 2015-11-02 14:26:10 UTC
@legitalk: You can always try a clean userdir [1] (without importing the old one, just to be sure).

Thanks for reporting.
[1] http://wiki.netbeans.org/FaqAlternateUserdir
Comment 29 legitalk 2015-11-02 14:31:28 UTC
(In reply to Tomas Mysik from comment #28)
> @legitalk: You can always try a clean userdir [1] (without importing the old
> one, just to be sure).
> 
> Thanks for reporting.
> [1] http://wiki.netbeans.org/FaqAlternateUserdir

Yes, thanks, but there is not mentioned 8.x (Applies to: NetBeans 3.6, 4.x, 5.x, 6.x, 7.0, 7.1), so I was not sure, if I can do this.

Also I tried this bug on clean userdir, then I created again that two projects, and later it freeze again after restarting NB IDE.
Comment 30 Tomas Mysik 2015-11-03 08:45:09 UTC
Should be fixed now we hope. Please, wait for a comment saying in which dev build the fix will be present and test it. If the problem still exists, reopen this issue and attach a new thread dump.

Thanks Jardo for your help.

http://hg.netbeans.org/web-main/rev/0f7329c98965
Comment 31 legitalk 2015-11-03 09:47:47 UTC
Ok, thanks. I will wait for info about DEV build, in which it will be present. Till then I am using 8.0.2, in which this bug is not present; but I am strugling with another bug - 248481 - Really slow ftp upload, which is present in 8.0.2, but fixed in newer versions...

Hope you can publish it ASAP. Thanks.
Comment 32 Quality Engineering 2015-11-04 02:30:46 UTC
Integrated into 'main-silver', will be available in build *201511040002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0f7329c98965
User: Tomas Mysik <tmysik@netbeans.org>
Log: #256017 - NB freeze after start
Comment 33 legitalk 2015-11-04 15:35:48 UTC
Tested and looks like now its working and not freezing. Thanks. Great work!
Comment 34 Tomas Mysik 2015-11-05 06:56:35 UTC
(In reply to legitalk from comment #33)
> Tested and looks like now its working and not freezing. Thanks. Great work!

Thanks for verification.
Comment 35 Tomas Mysik 2016-01-27 09:03:18 UTC
Transplanted to release81 branch of releases repo:


http://hg.netbeans.org/releases/rev/3084344fc691
http://hg.netbeans.org/releases/rev/31f54a9a4fd6

Please verify, if possible. Thanks.
Comment 36 Jiri Prox 2016-02-04 13:24:55 UTC
legitalk can you please verify this issue one more time? this time in 8.1patch1.

The patch process is described at page
http://wiki.netbeans.org/NetBeans_81_Patch1_GoNoGo
in section "Upgrade from 8.1 to Patch 1 sanity test" 

Thanks