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 232389 - toolbar with New Project is missed after IDE is started
Summary: toolbar with New Project is missed after IDE is started
Status: REOPENED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.4
Hardware: PC All
: P2 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: 7.4_WAIVER_APPROVED
: 234145 234277 242622 (view as bug list)
Depends on:
Blocks: 242622
  Show dependency tree
 
Reported: 2013-07-08 13:50 UTC by soldatov
Modified: 2017-03-04 10:48 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The Thread Dump (22.13 KB, text/plain)
2013-07-11 20:35 UTC, soldatov
Details
messages.log (28.35 KB, text/plain)
2013-07-11 20:37 UTC, soldatov
Details
NetBeans with -J-Dorg.openide.loaders.FolderInstance.Toolbars.File.level=FINEST (41.61 KB, text/plain)
2013-07-13 14:41 UTC, soldatov
Details
/usr/local/netbeans-dev/bin/netbeans -J-Dorg.openide.loaders.FolderInstance.Toolbars.level=FINEST --userdir /var/tmp/sova1 (105.23 KB, text/plain)
2013-07-17 19:10 UTC, soldatov
Details
/usr/local/netbeans-dev/bin/netbeans -J-Dorg.openide.loaders.FolderInstance.Toolbars.level=FINEST --userdir /var/tmp/sova (111.04 KB, text/plain)
2013-07-20 17:44 UTC, soldatov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2013-07-08 13:50:22 UTC
Hello Stanislav,

In QA tests we see the following situation: toolbar with New Project is missed after IDE is started. And it is missed from the View -> Toolbars menu as well.

This situations is not always reproducible, but in 100 tests runs we can always find this effect.

It also can be reproduced on Ubuntu: multiple manual starting of IDE produces such effect (Valeriy can provide the details).

Default logs do not contain any glue on the issue. Is there are any special logging that should be turned on to get more information on this?

Regards,
 Igor
Comment 1 soldatov 2013-07-08 13:51:27 UTC
More exactly. I see such exception in messages.log:

INFO [org.openide.loaders.FolderInstance.Toolbars]: Cannot create org.openide.loaders.FolderInstance$HoldInstance@229761[Toolbars/File]
java.io.IOException: Cyclic reference. Somebody is trying to get value from FolderInstance (org.openide.awt.Toolbar$Folder) from the same thread that is processing the instance
    at org.openide.loaders.FolderInstance.instanceCreate(FolderInstance.java:299)
    at org.openide.loaders.FolderInstance.instanceForCookie(FolderInstance.java:580)
    at org.openide.loaders.FolderInstance$HoldInstance.instanceCreate(FolderInstance.java:1150)
[catch] at org.openide.loaders.FolderInstance$1R.instances(FolderInstance.java:700)
    at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:721)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)
Comment 2 Jaroslav Havlin 2013-07-08 14:08:11 UTC
This issue probably belongs to component platform/Window System.
Comment 3 Stanislav Aubrecht 2013-07-11 12:48:10 UTC
(In reply to comment #2)
> This issue probably belongs to component platform/Window System.

Ok, but please first explain what that error message means so that I know what I should be looking for and reassign back, thanks.
Comment 4 Jaroslav Havlin 2013-07-11 13:14:18 UTC
(In reply to comment #3)
> Ok, but please first explain what that error message means so that I know what
> I should be looking for and reassign back, thanks.
I'm not sure, too.

> More exactly. I see such exception in messages.log:
Can you please attach your full IDE Log to the issue?

It might be also helpful to have a thread dump, to see what's happening if the toolbar isn't initialized (http://wiki.netbeans.org/GenerateThreadDump).

Thank you.
Comment 5 soldatov 2013-07-11 20:35:53 UTC
Created attachment 137016 [details]
The Thread Dump
Comment 6 soldatov 2013-07-11 20:37:35 UTC
Created attachment 137017 [details]
messages.log
Comment 7 Jaroslav Havlin 2013-07-12 07:57:46 UTC
> Default logs do not contain any glue on the issue.
I'm very sorry, I've somehow missed this note.

> Is there are any special logging that should be turned on to get more 
> information on this?
The logging can be turned on with this parameter:
-J-Dorg.openide.loaders.FolderInstance.Toolbars.File.level=FINEST

Which release do you use for testing? A custom build, or a development build downloaded from NetBeans web site (if so, which type [ZIP,installer] and bundle [full,C++])?

Thank you.
Comment 8 soldatov 2013-07-12 08:06:28 UTC
(In reply to comment #7)
> Which release do you use for testing? A custom build, or a development build
> downloaded from NetBeans web site (if so, which type [ZIP,installer] and bundle
> [full,C++])?
automatic tests uses custom build
I use builds from netbeans.org (installer, C++ only)
Comment 9 soldatov 2013-07-13 14:41:08 UTC
Created attachment 137072 [details]
NetBeans with -J-Dorg.openide.loaders.FolderInstance.Toolbars.File.level=FINEST
Comment 10 Jaroslav Havlin 2013-07-17 12:02:51 UTC
(In reply to comment #9)
> Created attachment 137072 [details]
> NetBeans with -J-Dorg.openide.loaders.FolderInstance.Toolbars.File.level=FINEST
Thank you very much for the log.

It seems that three instances of toolbar defined in Toolbars/File were created (instead of just one instance), which leads to an illegal state.
But unfortunately I cannot find why this happens.

Can you please change the logging parameter to this one? Thanks.
 -J-Dorg.openide.loaders.FolderInstance.Toolbars.level=FINEST
Comment 11 soldatov 2013-07-17 19:10:54 UTC
Created attachment 137334 [details]
/usr/local/netbeans-dev/bin/netbeans -J-Dorg.openide.loaders.FolderInstance.Toolbars.level=FINEST --userdir /var/tmp/sova1
Comment 12 Jaroslav Havlin 2013-07-19 09:29:01 UTC
I'm sorry, I haven't managed to create a test case for this bug yet.

I've added some logging into FolderInstance:
http://hg.netbeans.org/core-main/rev/690094c522d3
http://hg.netbeans.org/core-main/rev/4844fefb1ece

Please attach a new messages.log after the changes are propagated.
Thank you.
Comment 13 Quality Engineering 2013-07-20 02:11:30 UTC
Integrated into 'main-silver', will be available in build *201307192300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4844fefb1ece
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #232389: FolderInstance.waitFinished - Log value of the local reference
Comment 14 soldatov 2013-07-20 17:44:04 UTC
Created attachment 137487 [details]
/usr/local/netbeans-dev/bin/netbeans -J-Dorg.openide.loaders.FolderInstance.Toolbars.level=FINEST --userdir /var/tmp/sova
Comment 15 Jaroslav Havlin 2013-07-26 10:21:44 UTC
Thank you for the new log. Unfortunately, all parts of the code that I suspected of causing the problem work correctly, and I haven't been able to reproduce the bug yet. I'll have to estimate which other parts could be problematic.
Comment 16 Stanislav Aubrecht 2013-08-12 16:02:56 UTC
*** Bug 234277 has been marked as a duplicate of this bug. ***
Comment 17 soldatov 2013-08-12 16:21:50 UTC
*** Bug 234145 has been marked as a duplicate of this bug. ***
Comment 18 Alexander Pepin 2013-08-12 16:59:56 UTC
The bug appears during manual testing as well and it looks like a consequences of some races. 
I was able to reproduce the bug using a simple scenario:
- run IDE with a fresh userdir
- create a sample project then close it
- close IDE
- do run and close IDE with the same userdir several times
After several attempts IDE starts without File toolbar.
Comment 19 Jaroslav Havlin 2013-08-22 12:47:29 UTC
I've sent a waiver request for this bug.
It's difficult to debug, and fixing it would be probably quite risky.
I would prefer to have much more time for testing changes in this area.
Comment 20 Jaroslav Havlin 2013-09-06 09:47:36 UTC
> It seems that three instances of toolbar defined in Toolbars/File were
> created (instead of just one instance), which leads to an illegal state.
> But unfortunately I cannot find why this happens.
This doesn't cause the bug directly. I've temporarily changed the code
so that the instances were duplicated artificially, and started NetBeans several
times, but the bug didn't appear (Linux, OpenJDK 7u25).
Creating duplicate instances for the same folder in a test case also worked well.
(But duplicated instances may still be a necessary condition.)
Comment 21 Jaroslav Havlin 2013-09-06 11:18:31 UTC
http://hg.netbeans.org/core-main/rev/e9f8dd1301d7
Prevent creation of duplicate instances of Toolbar.Folder for single Toolbar.

If the bug appears again, please attach new IDE Log. Thanks.
Comment 22 Jaroslav Havlin 2013-11-04 16:18:24 UTC
Can you still reproduce the bug with a recent daily build? If so, please attach
new IDE Log (using  -J-Dorg.openide.loaders.FolderInstance.Toolbars.level=FINEST).
Thank you.
Comment 23 Jaroslav Havlin 2014-01-09 14:15:49 UTC
> If the bug appears again, please attach new IDE Log. Thanks.
It seems that the problem has been solved. If not, please reopen this issue.
Thank you very much for help.
Comment 24 Jaroslav Havlin 2014-06-20 10:23:56 UTC
*** Bug 242622 has been marked as a duplicate of this bug. ***
Comment 25 Lusito 2017-03-04 10:48:18 UTC
I'm having this issue on NetBeans 8.2
Both on the IDE as well as a NB-Platform application.