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 146557 - Sunstudio 12 netbeans IDE unable to handle files over 1Mb
Summary: Sunstudio 12 netbeans IDE unable to handle files over 1Mb
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: sustaining
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-08 19:18 UTC by Thomas Preisler
Modified: 2009-02-10 15:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test case (3 files from Linux kernel concatenated) (376.37 KB, application/x-gzip)
2008-09-11 10:55 UTC, Alexey Vladykin
Details
java stack trace (16.27 KB, text/plain)
2008-09-23 15:21 UTC, Alexander Pepin
Details
SSIDE java stacktrace (13.77 KB, text/plain)
2008-09-23 15:55 UTC, Alexander Pepin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Preisler 2008-09-08 19:18:28 UTC
Originally CR 6745708 and escalation # 1-24574501

Please evaluate and possible also fix in 6.5.

Sunstudio 12 netbeans IDE does not handle files over 1Mb like previous sunstudio releases.

When opening source files (C++) over 1Mb in sunstudio 12 netbeans IDE, you get a warning saying the file is too large to be safely open and would make the IDE unusable.
If you despite open a file around 1.7Mb, it will be displayed in the editor correctly.
Exiting the IDE without closing the file and relaunching the IDE will make the file editing window blank for that file or the IDE will hang with the following netbeans error logs :

java.lang.IllegalStateException: [Winsys] TopComponent 
org.netbeans.modules.cnd.loaders.CppEditorSupport$CppEditorComponent[g.cpp,0,0,589x409,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=256,maximum
Size=,minimumSize=,preferredSize=] throws runtime exception from its componentActivated() method. Repair it!
[catch] at org.openide.windows.WindowManager.activateComponent(WindowManager.java:255)
        at org.netbeans.core.windows.WindowManagerImpl.notifyRegistryTopComponentActivated(WindowManagerImpl.java:923)
...

(complete error stack trace in attachment)

previous releases of sunstudio do not show this limitation and/or allowed alternate editors (editors that do not map the whole file in memory but use temporary files for editing).
*** (#1 of 1): 2008-09-08 01:39:50 PDT ...

also fails with netbeans 6.5
*** (#1 of 2): 2008-09-08 01:39:50 PDT ...

This issue was also discussed at:
http://mailfinder3.sfbay.sun.com/message/5402965
   ...There have been similar issues filed against other modules.
   For instance: http://www.netbeans.org/issues/show_bug.cgi?id=133746
   has been filed against the xml module.  The bug entry also has the link
   to the fix that was made in xml module, which might prove a handy
   reference if and when the fix is made in the cnd module....
*** (#2 of 2): 2008-09-08 10:12:38 PDT ...
Comment 1 ivan 2008-09-08 21:51:25 UTC
There is a variation on the problem where once the huge file is accepted,
the IDE exited, then upon subsequent automatic re-opening of the file during IDE 
startup, the editor view is empty and there is an NPE when some warning is
printed into the editor status area. THE NPE happens because the Document
assigned to the editor is null.

java.lang.NullPointerException
        at 
org.netbeans.modules.editor.NbEditorUI.getDocumentContentType(NbEditorUI.java:156)
        at 
org.netbeans.modules.editor.NbEditorUI.createColoringMap(NbEditorUI.java:189)
        at 
org.netbeans.modules.editor.NbEditorUI.getColoringMap(NbEditorUI.java:742)
        at 
org.netbeans.editor.EditorUI.getDefaultColoring(EditorUI.java:715)
        at org.netbeans.editor.StatusBar.settingsChange(StatusBar.java:153)
        at org.netbeans.editor.StatusBar.propertyChange(StatusBar.java:298)
        at org.netbeans.editor.StatusBar.<init>(StatusBar.java:141)
        at org.netbeans.editor.EditorUI.getStatusBar(EditorUI.java:975)
        at org.netbeans.editor.Utilities.setStatusText(Utilities.java:963)
        at org.netbeans.editor.Utilities.clearStatusText(Utilities.java:990)
        at 
com.sun.tools.debugger.dbxgui.debugger.EditorBridge.setStatus(EditorBridge.java:372)
        at 
Comment 2 Leonid Lenyashin 2008-09-09 10:49:27 UTC
That is not a P2 for 6.5 release. in other words we can release still having this issue. At the same time we will have a
look and try to help.
Comment 3 Alexey Vladykin 2008-09-10 10:16:17 UTC
Not reproducible in NB 6.5. Likely to be fixed in http://hg.netbeans.org/main/rev/5ab5287545fa.
Comment 4 Alexey Vladykin 2008-09-11 10:55:06 UTC
Created attachment 69631 [details]
Test case (3 files from Linux kernel concatenated)
Comment 5 rbalada 2008-09-16 12:48:12 UTC
The referred patch http://hg.netbeans.org/main/rev/5ab5287545fa was part of NetBeans 6.1 FCS release. It's unlikely this
changeset fixed this issue, if the issue was (AFAIK) found/reproduced in NB 6.1.
Comment 6 Alexander Pepin 2008-09-23 15:20:12 UTC
Issue is reproducible in NB 6.1, IDE hangs after restart with a big file opened in the editor. 
java stack trace is attached.
Comment 7 Alexander Pepin 2008-09-23 15:21:17 UTC
Created attachment 70325 [details]
java stack trace
Comment 8 rbalada 2008-09-23 15:29:35 UTC
Updated version and priority to match context of the issue
Comment 9 Alexey Vladykin 2008-09-23 15:39:02 UTC
In the attached stack dump I can see that "Refresh Editor Context" thread is blocked by "AWT-EventQueue-1". Lock is held
by org.netbeans.modules.debugger.jpda.projects.EditorContextImpl. Looks like this hang has nothing to do with CND.

"Refresh Editor Context" daemon prio=3 tid=0x08f1f400 nid=0x24 waiting for monitor entry [0xf77ff000..0xf77ffbf0]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.getCurrentURL(EditorContextImpl.java:515)
	- waiting to lock <0xb0194b40> (a java.lang.Object)


"AWT-EventQueue-1" prio=3 tid=0x08e74800 nid=0x21 in Object.wait() [0xf8ffe000..0xf8fff970]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0xb0e751b0> (a org.openide.text.CloneableEditor$DoInitialize)
        ...
	at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.getCurrentEditorCookie(EditorContextImpl.java:1885)
	- locked <0xb0194b40> (a java.lang.Object)
Comment 10 Alexander Pepin 2008-09-23 15:45:14 UTC
The issue is not reproducible in NB6.5 so we need to find a changeset fixing this issue.
Comment 11 Alexander Pepin 2008-09-23 15:51:13 UTC
To be honest I attach java stacktrace for SunStuduio IDE based on NB6.1patch3.
Comment 12 Alexander Pepin 2008-09-23 15:55:11 UTC
Created attachment 70333 [details]
SSIDE java stacktrace
Comment 13 Alexander Pepin 2008-09-23 16:13:16 UTC
Downgraded as not a bug for NB6.5
Comment 14 Alexey Vladykin 2008-09-23 16:45:10 UTC
The candidate changeset to fix the hang is http://hg.netbeans.org/main/rev/fe15228c9896 (see IZ 136601).
Comment 15 rbalada 2008-09-24 10:37:48 UTC
This is *Sun Services* driven issue for NB 5.5.1, 6.0.1 and 6.1. Back to P2 priority, because this issue *must* be P1 or
P2, if it has to go to NB Patch of any releases from NB 5.5.1 to 6.1 including. 

I do admit, this issue is not P2 for 6.5, however that's why version field says "6.1".

Do not touch the priority unless pre-approved by NetBeans Sustaining team. Thank you for understanding.

Comment 16 rbalada 2008-09-24 11:56:25 UTC
Alexey,

thank you for providing the changeset. I'll check the changeset with Marek Slama first, because it failed apply to
release61_fixes when I tried to transplant it.

-R
Comment 17 rbalada 2008-10-16 13:37:00 UTC
I've committed the change into release551_fixes branch in CVS repository cvs.netbeans.org:/cvs

Checking in manifest.mf;
/shared/data/ccvs/repository/openide/text/Attic/manifest.mf,v  <--  manifest.mf
new revision: 1.8.4.1.2.3.6.2.4.1; previous revision: 1.8.4.1.2.3.6.2
done
Checking in src/org/openide/text/CloneableEditor.java;
/shared/data/ccvs/repository/openide/text/src/org/openide/text/Attic/CloneableEditor.java,v  <--  CloneableEditor.java
new revision: 1.5.6.2.2.1.30.1; previous revision: 1.5.6.2.2.1
done
Checking in src/org/openide/text/CloneableEditorSupport.java;
/shared/data/ccvs/repository/openide/text/src/org/openide/text/Attic/CloneableEditorSupport.java,v  <-- 
CloneableEditorSupport.java
new revision: 1.6.6.1.2.2.10.1.6.1; previous revision: 1.6.6.1.2.2.10.1
done
Comment 18 rbalada 2008-11-11 09:17:41 UTC
I've pushed the fix to release61_fixes repository as http://hg.netbeans.org/release61_fixes/rev/22ead8b7b9f2 .

It's a combination of changeset referred in desc18 of this issue and two changesets fixing issue 136601
http://hg.netbeans.org/main/rev/2c6d217d573a and http://hg.netbeans.org/main/rev/fe15228c9896

This issue is virtually in VERIFIED FIXED state in context of NB 6.1. I'll keep this issue opened until after this issue
would have been fixed also in release601_fixes CVS branch.

Side note: during testing of this fix there were several occurrences of java.lang.NoSuchMethodError related to newly
added method, which for some (unknown) reason does not get inherited into some modules/classes. To get this fixed in
C/C++ context, all C/C++ modules depending on CloneableEditor resp. CloneableEditorSupport classes need to be refreshed
on UC with updated dependency on fixed openide.text module. This includes four modules cnd(.core), cnd.completion,
cnd.modelutil and cnd.refactoring. This has been covered in specification version increment changeset
http://hg.netbeans.org/release61_fixes/rev/93949c273fff . Unfortunately this may, but must not introduce appearance of
java.lang.NoSuchMethodError in other areas of usage of NetBeans IDE. This needs wider functional testing. Similar issue
 happened for new field added in NB 6.1 Patch2 and it is described in issue 150037. Basically it should be relatively
safe to ignore the exception. The most correct solution seems to be UC refresh of all modules directly depending on
CloneableEditor resp. CloneableEditorSupport classes, but it's more than 80 modules and the only change would be that
it's just compiled against newer openide.text without any further change. Also it's not know at this moment, which
modules are behind the java.lang.NoSuchMethodError exception, so the list of modules has been limited just to C/C++
area. In other words, this is good candidate to remove from patch, but still worth trying. Hanging IDE is more serious
issue than occasional appearance of java.lang.NoSuchMethodError, which does not seem to have an influence on IDE
fucntionality.

Comment 19 Alexander Pepin 2008-11-11 15:06:43 UTC
verified in 5.5.1 with manually installed nbms from PromoG1Patch4
Comment 20 Alexander Pepin 2009-01-23 13:16:33 UTC
verified in 6.1patch5
Comment 21 Alexander Pepin 2009-01-23 13:18:29 UTC
It seems to be fixed and verified for all NB versions