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 131307

Summary: Loading C/C++ module when .h file is open causes IDE to not restart
Product: projects Reporter: dynamite <dynamite>
Component: Generic Projects UIAssignee: Milan Kubec <mkubec>
Status: RESOLVED FIXED    
Severity: blocker CC: jtulach, lhasik, mmirilovic, musilt2
Priority: P1 Keywords: THREAD
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log with exception for spconstants.h
thread dump
module with fix
patch

Description dynamite 2008-03-27 16:15:25 UTC
I had a .h file open in the editor.  I though that it would be quite useful to have some syntax highlighting as well. 
So I added the C/C++ module through the plug-in manager and allowed the IDE to restart straight away.  Unfortunately it
seems that the previously opened .h file is now stopping my IDE from starting.  It freezes at the point where it has
launched the main IDE window but has yet to close-down the splash screen.

I get the feeling that there is probably a .ser or some-such file that will let me overcome this problem, but I'm not
sure what it is.

Please find my message.log file with exception attached.
Comment 1 dynamite 2008-03-27 16:16:26 UTC
Created attachment 59223 [details]
IDE log with exception for spconstants.h
Comment 2 Marian Mirilovic 2008-03-29 11:17:38 UTC
Could you please generate thread-dump when the IDE freezes ?
http://wiki.netbeans.org/GenerateThreadDump
Comment 3 dynamite 2008-03-31 09:38:31 UTC
Created attachment 59387 [details]
thread dump
Comment 4 dynamite 2008-03-31 09:39:27 UTC
The stdout also includes the following lines which may be of interest

ALL [null]: Source: MultiFileObject@19e0019[Windows2Local/Components/SPconstants.settings]
ALL [null]: Cannot read class: org.openide.text.CloneableEditor
Comment 5 Marian Mirilovic 2008-04-01 21:57:41 UTC
*** Issue 131745 has been marked as a duplicate of this issue. ***
Comment 6 dynamite 2008-04-02 09:59:14 UTC
I have kept my old user areas in case they prove to be helpful in the future, such as for testing a fix.  I will keep
them until this issue is resolved.
Comment 7 Milan Kubec 2008-04-02 10:37:22 UTC
I'd like to reproduce the deadlock to verify the fix. What version of IDE did you use exactly? Java SE only? Please
describe exactly steps to reproduce. How did you open .h file? What was opened in editor in the time of restart? Etc. Thanks
Comment 8 Milan Kubec 2008-04-02 11:31:05 UTC
Please find attached module with proposed fix and verify in your environment whether the issue is fixed. I'm not able to
reproduce the problem. Thanks.
Comment 9 Milan Kubec 2008-04-02 11:32:23 UTC
Created attachment 59533 [details]
module with fix
Comment 10 Milan Kubec 2008-04-02 11:33:43 UTC
The module is to be placed under netbeans/ide9/modules folder of your NB installation. 
Comment 11 Milan Kubec 2008-04-02 13:33:35 UTC
Created attachment 59543 [details]
patch
Comment 12 Milan Kubec 2008-04-02 13:34:29 UTC
I've attached patch.
Comment 13 Tomas Danek 2008-04-02 13:45:39 UTC
tried both on Windows XP, and Linux, and could not reproduce; my steps:
1) downloaded javaee distribution of IDE (from log it seems that you use this distribution)
2) started IDE (used fresh userdir)
3) opened and closed some project (in order to have some recent project)
4a) opened spconstants.h by File | Open file.. 
4b) tried also alternative scenario when spconstants.h was part of some javaproject - then opening was by doubleclick on
node in projects view
5) Tools|Plugins - installed C/C++ plugin
6) confirmed restart of IDE
7) IDE was restarted, and started ok, no file was opened in editor

reporter, could you please correct my steps how to reproduce this deadlock? Or eventually try the fix yourself, in order
to make sure fix works? Thanks in advance.


Comment 14 Milan Kubec 2008-04-02 14:14:40 UTC
Pushed to main:
http://hg.netbeans.org/main/rev/e09aad9b7bdd
Comment 15 dynamite 2008-04-02 14:52:00 UTC
I applied your fix and tried starting against each of my "bad" user areas and the IDE started in each case.  Magic!

Thank you for your effort in fixing this.  It is much appreciated.
Comment 16 Milan Kubec 2008-04-02 15:11:03 UTC
Thanks for verification. Could you please comment on "musilt2 Wed Apr 2 12:45:39" comment - we would like to verify the
fix also. Thanks.
Comment 17 dynamite 2008-04-02 15:36:07 UTC
The steps look fine.  Unfortunately, as you can see from the duplicate issue, although I hit this problem 3 times, I had
different things on each occasion.  It seems that there is some random element to this.  Is there any value with me
running again without the fix to see if I can recreate this myself?
Comment 18 Lukas Hasik 2008-04-02 15:43:22 UTC
dynamite, try to run the IDE with the patch. We will try the same either we cannot reproduce it. If there won't be any
new deadlock or re-appearance of the original deadlock then we will proceed with the integration of the fix to the 6.1
release.
Comment 19 Milan Kubec 2008-04-02 15:47:29 UTC
OK, I don't think you need to run IDE without the fix. Thanks anyway.
Comment 20 dynamite 2008-04-02 15:58:18 UTC
Okay, I've almost finished today.  I'll let you know how I get on tomorrow.
Comment 21 Milan Kubec 2008-04-03 09:28:19 UTC
Pushed to release61 repo.

http://hg.netbeans.org/release61/rev/ba48037cb778
Comment 22 Milan Kubec 2008-04-03 10:08:31 UTC
Change in release61 repo rollbacked. Waititng for QE approval.

http://hg.netbeans.org/release61/rev/0a2123364a77
Comment 23 Tomas Zezula 2008-04-03 10:16:04 UTC
The patch is OK, please integrate it.
Comment 24 dynamite 2008-04-03 22:56:47 UTC
I've had no problems all day despite a number of restarts.  It seems okay to me as well.
Comment 25 Tomas Danek 2008-04-04 14:05:52 UTC
since this fix works for reporter well, and i did not found any regression during testing projects (with project-ui JAR
containing your fix), please integrate into 6.1.
Comment 26 Milan Kubec 2008-04-04 15:18:50 UTC
Pushed to release61 repo again.

http://hg.netbeans.org/release61/rev/95f868ffc1e0