Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 162076 - Unable to parse <hudson>/main/core/src/main/java
Unable to parse <hudson>/main/core/src/main/java
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Action Items
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Stanislav Aubrecht
tasklist-issues@contrib
: REGRESSION
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-07 01:22 UTC by Jesse Glick
Modified: 2009-04-10 07:37 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
dump file (11.75 KB, text/plain)
2009-04-08 15:08 UTC, Max Sauer
Details
thread dump (21.89 KB, text/plain)
2009-04-08 15:11 UTC, Max Sauer
Details
Logging in TaskIndexer (603 bytes, text/plain)
2009-04-08 16:23 UTC, Vitezslav Stejskal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-04-07 01:22:44 UTC
In dev builds, if I run

.../bin/netbeans --userdir testud12 -J-Dnetbeans.full.hack=true /space/src/hudson/trunk/main/core

close the Task List and Navigator windows when they open and watch the progress handle, CP scanning goes up until
/space/src/hudson/trunk/main/core/src/main/java and then goes to 100% CPU. Memory usage goes to the maximum (500Mb on my
machine) and stays there. The IDE nearly freezes. If the close button is pressed, it takes a minute or two to actually
shut down.
Comment 1 Jesse Glick 2009-04-07 01:27:03 UTC
Reproduced in 4b485b21d7c0 and e7a02df524f2 but works fine in 6.7 M3, so a pretty recent regression.

$userdir/var/cache/index/s1/java/12/classes (the matching *.class dir) looks complete.
Comment 2 Jesse Glick 2009-04-07 18:55:31 UTC
In fact it seems that not just that source root but many other largish source roots cause the IDE to hang in CP
scanning. For example, parsing Apache Ant sources hung; and trying to close the IDE (and agreeing to stop Classpath
Scanning in the exit dialog) does not work:

"Java Source Worker Thread" daemon prio=10 tid=0x090ff800 nid=0x21c3 runnable [0xafcfc000..0xafcff030]
   java.lang.Thread.State: RUNNABLE
	at java.io.UnixFileSystem.checkAccess(Native Method)
	at java.io.File.canRead(File.java:691)
	at org.netbeans.modules.java.source.parsing.FolderArchive.getFiles(FolderArchive.java:104)
	at org.netbeans.modules.java.source.parsing.CachingFileManager.list(CachingFileManager.java:116)
	at org.netbeans.modules.java.source.parsing.ProxyFileManager.list(ProxyFileManager.java:174)
	at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2203)
	at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1840)
	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:405)
	at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:645)
	at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2213)
	at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1988)
	at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1655)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1886)
	at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1655)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:579)
	at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:503)
	at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:427)
	at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:439)
	at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:560)
	at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:450)
	at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:427)
	at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:968)
	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:405)
	at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:800)
	at com.sun.tools.javac.comp.Enter.complete(Enter.java:646)
	at com.sun.tools.javac.main.JavaCompiler.complete(JavaCompiler.java:732)
	at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1936)
	at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1836)
	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:405)
	at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:800)
	at com.sun.tools.javac.jvm.ClassReader.loadClass(ClassReader.java:2018)
	at com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:870)
	at com.sun.tools.javac.comp.Resolve.findGlobalType(Resolve.java:934)
	at com.sun.tools.javac.comp.Resolve.findType(Resolve.java:986)
	at com.sun.tools.javac.comp.Resolve.findIdent(Resolve.java:1015)
	at com.sun.tools.javac.comp.Resolve.resolveIdent(Resolve.java:1191)
	at com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:1799)
	at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:1683)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1886)
	at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1655)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:398)
	at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1325)
	at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1299)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:405)
	at com.sun.tools.javac.comp.Attr.visitExec(Attr.java:1095)
	at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1145)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:418)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:434)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:790)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:768)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:418)
	at com.sun.tools.javac.comp.Attr.visitTry(Attr.java:959)
	at com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:1026)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:418)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:434)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:790)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:768)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:418)
	at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:704)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:656)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:381)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:418)
	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2804)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2730)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2661)
	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1123)
	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1094)
	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:457)
	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:436)
	at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:529)
	at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.toPhase(CompilationInfoImpl.java:351)
	at org.netbeans.api.java.source.CompilationController.toPhase(CompilationController.java:106)
	at org.netbeans.modules.j2ee.jpa.verification.JPAProblemFinder$ProblemFinderCompControl.run(JPAProblemFinder.java:390)
	at org.netbeans.modules.j2ee.jpa.verification.JPAProblemFinder$ProblemFinderCompControl.run(JPAProblemFinder.java:384)
	at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:450)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:129)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:113)
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:188)
	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:99)
	at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:405)
	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:376)
	at org.netbeans.modules.j2ee.jpa.verification.JPAVerificationTaskProvider.scan(JPAVerificationTaskProvider.java:84)
	at org.netbeans.modules.tasklist.impl.TaskIndexer.index(TaskIndexer.java:102)
	at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor.index(Indexable.java:141)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.index(RepositoryUpdater.java:691)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.scanSource(RepositoryUpdater.java:1144)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.scanSources(RepositoryUpdater.java:1121)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.getDone(RepositoryUpdater.java:949)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:736)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:1275)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:1250)
	at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:601)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)

"AWT-EventQueue-1" prio=10 tid=0x09395c00 nid=0x219d in Object.wait() [0xb3871000..0xb3872030]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.cancelAll(RepositoryUpdater.java:1213)
	- locked <0x6b4cef20> (a java.util.LinkedList)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.stop(RepositoryUpdater.java:145)
	- locked <0x6aa28ac8> (a org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater)
	at org.netbeans.modules.parsing.impl.Installer.closing(Installer.java:40)
	at org.netbeans.core.startup.NbInstaller.closing(NbInstaller.java:664)
	at org.netbeans.ModuleManager.shutDown(ModuleManager.java:1572)
	at org.netbeans.core.startup.ModuleSystem.shutDown(ModuleSystem.java:291)
	at org.netbeans.core.NbTopManager.doExit(NbTopManager.java:514)
	at org.netbeans.core.NbTopManager.access$500(NbTopManager.java:93)
	at org.netbeans.core.NbTopManager$ExitActions.run(NbTopManager.java:465)
	at org.openide.util.Mutex.doEvent(Mutex.java:1335)
	at org.openide.util.Mutex.readAccess(Mutex.java:345)
	at org.netbeans.core.NbTopManager.exit(NbTopManager.java:496)
	at org.netbeans.core.NbTopManager$NbLifecycleManager.exit(NbTopManager.java:561)
	at org.netbeans.core.windows.view.ui.MainWindow$3.windowClosing(MainWindow.java:353)
	at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
	at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
	at java.awt.Window.processWindowEvent(Window.java:1845)
	at javax.swing.JFrame.processWindowEvent(JFrame.java:279)
	at java.awt.Window.processEvent(Window.java:1803)
	at java.awt.Component.dispatchEventImpl(Component.java:4501)
	at java.awt.Container.dispatchEventImpl(Container.java:2081)
	at java.awt.Window.dispatchEventImpl(Window.java:2458)
	at java.awt.Component.dispatchEvent(Component.java:4331)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

It has to be killed from the command line.
Comment 3 Rastislav Komara 2009-04-08 13:58:49 UTC
@jglick: Thanks Jesse. We reach the same point in our analysis. Making steps to prevent such a problems.
Comment 4 Vitezslav Stejskal 2009-04-08 14:38:41 UTC
I think there are two problems - (1) TaskIndexer (and through it all TaskProviders) run before JavaCustomIndexer during
the initial scan and (2) JPAProblemFinder launches usertask for every java file it is given. The combination of these
two problems can lead to OOME and symptoms that you are describing, becuase the usertask run by JPAPF will cause
excessive java compilation. I'll change the order of the indexers, which should significantly improve the situation. But
ultimately JPAPF should be fixed to check only relevant files and not just any java file.
Comment 5 Vitezslav Stejskal 2009-04-08 14:52:30 UTC
Similar stacktrace from my laptop, but with org.netbeans.modules.j2ee.ejbverification.EJBVerificationTaskProvider
causing the problem.

"Java Source Worker Thread" daemon prio=1 tid=0xa5c64768 nid=0x3c0c waiting on condition [0xa5ff8000..0xa5ff90c0]
com.sun.tools.javac.util.SharedNameTable.fromUtf(SharedNameTable.java:143)
com.sun.tools.javac.util.Name.append(Name.java:94)
com.sun.tools.javac.code.Symbol$TypeSymbol.formFlatName(Symbol.java:532)
com.sun.tools.javac.jvm.ClassReader.enterClass(ClassReader.java:1745)
com.sun.tools.javac.jvm.ClassReader.includeClassFile(ClassReader.java:2087)
com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2244)
com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2203)
com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1840)
com.sun.tools.javac.code.Symbol.complete(Symbol.java:405)
com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:324)
com.sun.tools.javadoc.JavadocEnter.visitTopLevel(JavadocEnter.java:77)
com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:450)
com.sun.tools.javac.comp.Enter.classEnter(Enter.java:283)
com.sun.tools.javac.comp.Enter.classEnter(Enter.java:297)
com.sun.tools.javac.comp.Enter.complete(Enter.java:639)
org.netbeans.modules.java.source.parsing.ErrorHandlingJavadocEnter.main(ErrorHandlingJavadocEnter.java:77)
com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:897)
com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:367)
com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:313)
org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:526)
org.netbeans.modules.java.source.parsing.CompilationInfoImpl.toPhase(CompilationInfoImpl.java:351)
org.netbeans.api.java.source.CompilationController.toPhase(CompilationController.java:106)
org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompControl.run(EJBProblemFinder.java:217)
org.netbeans.modules.j2ee.ejbverification.EJBProblemFinder$ProblemFinderCompControl.run(EJBProblemFinder.java:211)
org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:450)
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:129)
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:113)
org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:188)
org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:99)
org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:405)
org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:376)
org.netbeans.modules.j2ee.ejbverification.EJBVerificationTaskProvider.scan(EJBVerificationTaskProvider.java:75)
org.netbeans.modules.tasklist.impl.TaskIndexer.index(TaskIndexer.java:102)
org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor.index(Indexable.java:141)
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.index(RepositoryUpdater.java:755)
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.scanSource(RepositoryUpdater.java:1273)
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.scanSources(RepositoryUpdater.java:1249)
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.getDone(RepositoryUpdater.java:1077)
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:803)
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:1404)
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:1379)
org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:601)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
java.util.concurrent.FutureTask.run(FutureTask.java:123)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
java.lang.Thread.run(Thread.java:595)
Comment 6 Max Sauer 2009-04-08 15:08:34 UTC
Created attachment 79741 [details]
dump file
Comment 7 Max Sauer 2009-04-08 15:11:19 UTC
Created attachment 79742 [details]
thread dump
Comment 8 Vitezslav Stejskal 2009-04-08 16:22:27 UTC
Ok, the indexers run in correct order, but it looks like tasklist filter does not work correctly. If the tasklist window
is opened the filter works fine and TaskIndexer runs only FileTaskScanners that are allowed in the filter. But when the
tasklist window is closed suddenly *all* FileTaskScanners are used.

I'm going to attach patch which prints FileTaskScanners used by TaskIndexer during indexing. Here is the list of
scanners that I got when

1. launched IDE with emtpy userdir
2. created new java project (list A)
3. closed tasklist window
4. restarted IDE and selected Main.java editor (list B)

listA: 
  org.netbeans.modules.tasklist.todo.TodoTaskScanner@dc54ce

listB:
  org.netbeans.modules.j2ee.jpa.verification.JPAVerificationTaskProvider@25adb1
  org.netbeans.modules.tasklist.todo.TodoTaskScanner@d5698f
  org.netbeans.modules.maven.hints.pom.TaskListBridge@1052dc3

Comment 9 Vitezslav Stejskal 2009-04-08 16:23:19 UTC
Created attachment 79754 [details]
Logging in TaskIndexer
Comment 10 Jesse Glick 2009-04-08 17:41:42 UTC
FYI, I usually keep the Task List window closed, as this (usually!) makes the IDE faster.
Comment 11 Vitezslav Stejskal 2009-04-09 09:10:10 UTC
Problems with JPAVerificationTaskProvider and EJBVerificationTaskProvider are tracked in issue #162133.
Comment 12 Stanislav Aubrecht 2009-04-09 16:34:25 UTC
fixed

core-main 866efed22143 
Comment 13 Quality Engineering 2009-04-10 07:37:09 UTC
Integrated into 'main-golden', will be available in build *200904100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/866efed22143
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #162076 - do not scan for tasks when task list window is closed


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo