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 158664 - IDE hangs when "insert code"
Summary: IDE hangs when "insert code"
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Jan Jancura
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2009-02-17 12:30 UTC by farcat
Modified: 2009-04-16 18:04 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thread dump (14.41 KB, text/plain)
2009-02-24 16:09 UTC, farcat
Details
thread dump2 (14.64 KB, text/plain)
2009-02-24 16:25 UTC, farcat
Details
thread dump for fix imports hang (14.68 KB, text/plain)
2009-02-24 16:29 UTC, farcat
Details
thread dump after when deleting some generic code (14.46 KB, text/plain)
2009-02-24 21:28 UTC, farcat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description farcat 2009-02-17 12:30:11 UTC
This is one of several hangs i get when i use the IDE. I am refactoring some code (manually) and when i want to use the
function "inset code" the java engine starts to use full processor capacity and the IDE becomes completely unresponsive.
This forces me to rewrite code and to edit code in illogical order (to avoid the hang). I make extensive use of generics
and get the string impression that the hangs i get are related to a combination of generics use and the real time
parsing process (red underlining on errors). These hangs are 100% repeatable although pinpointing the exact code causing
the hang is difficult.  

This is becoming real bothersome and i am considering turning the real time parsing off. How can i do that?

Please inform me if any log or other file could help finding this bug.
Comment 1 farcat 2009-02-17 12:36:23 UTC
This hang now also happens on "fix imports"
Comment 2 Jindrich Sedek 2009-02-24 10:12:37 UTC
The most usefull information about hangs is the thread dump. Please try to create a thread dump and attach it to the 
issue.
h
ttp://wiki.netbeans.org/GenerateThreadDump
Comment 3 Jan Jancura 2009-02-24 16:07:29 UTC
Some how to reproduce steps? Some sourcefile?
Thanks
Comment 4 farcat 2009-02-24 16:09:23 UTC
Created attachment 77300 [details]
thread dump
Comment 5 farcat 2009-02-24 16:23:32 UTC
Lost my comment when i attached the file :-(. This seems to be from a similar hang, although i am not sure. Sometimes
(this time) after a hang, and after the restart the IDE gets stuck in project/task scanning. i can continue editting and
after a while the code seems digestible again and the real time parsing (i think) finishes (code folds, bold lettering
and red underlines work again). Also it is hard to pinpoint the source that hangs the IDE. It usually happens at an
inconvenient time after i have not saved for a while and during some more extensivce overhauling, so reconstructing the
exact steps is difficult. Basically I have no idea what causes it, apart from that probably generics are involved (maybe
some recursion due to being halfway some large edit). I have noticed that sometimes the order of editing makes a difference.

Since the IDE is still in task/project scanning i will attach another dump.
Comment 6 farcat 2009-02-24 16:25:13 UTC
Created attachment 77305 [details]
thread dump2
Comment 7 farcat 2009-02-24 16:29:47 UTC
Created attachment 77307 [details]
thread dump for fix imports hang
Comment 8 farcat 2009-02-24 21:28:40 UTC
Created attachment 77321 [details]
thread dump after when deleting some generic code
Comment 9 farcat 2009-02-24 21:31:44 UTC
actually the last thread dump after hang (max CPU) was when just selecting some code.
Comment 10 Jan Jancura 2009-02-25 12:57:48 UTC
Still can not reproduce. Can you attach your project, and some steps how to reproduce it?
Some info about your project type (Java Application), memory size and configuration (IDE Log)?
Comment 11 farcat 2009-03-08 15:34:33 UTC
Basically I think these hangs appear at two moments which are probaly the same problem but maybe not:

1) when doing major edits to generics code like introducing an new generics variavle that has implications for other
source files. This is hard to pinpoint.
2) After this happens and after restart the IDE usually gets stuck in task scanning, after which most refactoring
functionality in the right click menu makes the IDE hang (even though the latest edits are not saved, of course).

So, that could mean the edit in 1) starts the task scanning and the code hangs the IDE like in 2), meaning 1) and 2)
would be the same.
Comment 12 farcat 2009-03-12 11:38:04 UTC
switched back to NetBeans 6.1 a week ago, which seems more stable with my code (does that help, is there any chance of
getting some resolution on this issue?) 
Comment 13 pribyl 2009-04-16 13:41:03 UTC
I guess that without a sample project and/or exact steps to reproduce, we are unable to track this problem :-/

Farcat, are you able to reproduce this behavior on *any* (even sample) project, or just a specific one? Can you possibly
create some sample project, that you can attach here?

Thanks in advance
Comment 14 Vitezslav Stejskal 2009-04-16 18:04:25 UTC
The threaddumps show no deadlock. There was some activity in the old java RepositoryUpdater suggesting that the IDE was
indexing your sources, in which case tasks like fix imports, refactoring, etc have to wait. Anyway, this part of the
code has recently been heavily changed and there is probably no point in trying to analyze these old threaddumps. Please
try downloading a recent dev build or wait for the upcoming 6.7beta and check if it still shows the same behavior. If
so, please reopen this report and attach new threaddumps. Also it would be great if you could run the IDE with
-J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE on the command line, reproduce the hang and
attach the IDE's log file (ie. <ide-userdir>/var/log/messages.log) Thanks a lot