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 167623 - Scanning creates exit problem for IDE
Summary: Scanning creates exit problem for IDE
Status: RESOLVED DUPLICATE of bug 178999
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-24 22:10 UTC by greggwon
Modified: 2010-01-04 07:20 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description greggwon 2009-06-24 22:10:42 UTC
Here's a stack trace which simply illustrates the fundamental problem with netbeans scanning implementation.  Here
scanning is stuck (which is another bug I am trying to provide a test case for) and the IDE will not exit because a lock
in the scanning implementation is incorrectly causing an EDT thread to block and not be able to exit.

This kind of locking just makes no sense.  There are plenty of existing technologies and implementations and working
examples of code that implement lazy caching updates of data as a background activity that does not impact the progress
of other code.  The IDE should never be modifying something on disk which must be written completely to preserve the
sanity of disk stored data for scanning/indexing.  It should be writing temp files that are then renamed, added to an
index etc via a journal based mechanism that will allow the user to get the IDE to do exactly what they want done,
immediately, or with no more than a 1-2 second delay for things like exiting the IDE.


2009-06-24 16:02:23
Full thread dump Java HotSpot(TM) Client VM (11.0-b16 mixed mode):

"Parsing & Indexing Loop (200906142201)" daemon prio=2 tid=0x0543e400 nid=0x250 runnable [0x098ae000..0x098afd68]
   java.lang.Thread.State: RUNNABLE
        at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:391)
        at java.lang.StringBuilder.append(StringBuilder.java:119)
        at com.sun.tools.javac.util.JCDiagnostic$Factory.qualify(JCDiagnostic.java:155)
        at com.sun.tools.javac.util.JCDiagnostic$Factory.fragment(JCDiagnostic.java:151)
        at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:153)
        at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:557)
        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.Enter.complete(Enter.java:661)
        at com.sun.tools.javac.comp.Enter.main(Enter.java:624)
        at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:897)
        at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:367)
        at com.sun.tools.javac.api.JavacTaskImpl.enterTrees(JavacTaskImpl.java:406)
        at org.netbeans.modules.java.source.indexing.MultiPassCompileWorker.compile(MultiPassCompileWorker.java:173)
        at org.netbeans.modules.java.source.indexing.JavaCustomIndexer$1$1.run(JavaCustomIndexer.java:139)
        at org.netbeans.modules.java.source.indexing.JavaCustomIndexer$1$1.run(JavaCustomIndexer.java:124)
        at org.netbeans.modules.java.source.tasklist.TaskCache.refreshTransaction(TaskCache.java:470)
        at org.netbeans.modules.java.source.indexing.JavaCustomIndexer$1.run(JavaCustomIndexer.java:124)
        at org.netbeans.modules.java.source.indexing.JavaCustomIndexer$1.run(JavaCustomIndexer.java:122)
        at org.netbeans.modules.java.source.usages.ClassIndexManager.writeLock(ClassIndexManager.java:100)
        at org.netbeans.modules.java.source.indexing.JavaCustomIndexer.index(JavaCustomIndexer.java:122)
        at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor.index(Indexable.java:165)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.index(RepositoryUpdater.java:1152)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.scanSource(RepositoryUpdater.java:2075)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.scanSources(RepositoryUpdater.java:1992)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.getDone(RepositoryUpdater.java:1772)
        at
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$InitialRootsWork.getDone(RepositoryUpdater.java:2136)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:1345)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:2413)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:2369)
        at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:588)
        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)

"Swing-Shell" daemon prio=6 tid=0x05440400 nid=0x11f4 waiting on condition [0x096af000..0x096afd68]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x1303f0e8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:458)
        at java.lang.Thread.run(Thread.java:619)

"AWT-EventQueue-1" prio=6 tid=0x0543d000 nid=0x5ac in Object.wait() [0x06e2f000..0x06e2fc68]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1318f470> (a java.util.LinkedList)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.cancelAll(RepositoryUpdater.java:2233)
        - locked <0x1318f470> (a java.util.LinkedList)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.stop(RepositoryUpdater.java:182)
        at org.netbeans.modules.parsing.impl.Installer.closing(Installer.java:45)
        at org.netbeans.core.startup.NbInstaller.closing(NbInstaller.java:681)
        at org.netbeans.ModuleManager.shutDown(ModuleManager.java:1573)
        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)

"*** JFluid Separate Command Execution Thread" daemon prio=6 tid=0x0543c800 nid=0x1608 in Object.wait()
[0x0829f000..0x0829fce8]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x126d5408> (a java.lang.Object)
        at java.lang.Object.wait(Object.java:485)
        at org.netbeans.lib.profiler.ProfilerClient$SeparateCmdExecutionThread.run(ProfilerClient.java:102)
        - locked <0x126d5408> (a java.lang.Object)

"Thread-4" daemon prio=6 tid=0x0543c400 nid=0x13ac in Object.wait() [0x07dcf000..0x07dcfd68]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x12633a00> (a java.util.LinkedList)
        at java.lang.Object.wait(Object.java:485)
        at java.util.prefs.AbstractPreferences$EventDispatchThread.run(AbstractPreferences.java:1461)
        - locked <0x12633a00> (a java.util.LinkedList)

"TimerQueue" daemon prio=6 tid=0x0543ac00 nid=0xda4 in Object.wait() [0x0809f000..0x0809fa68]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x12046428> (a javax.swing.TimerQueue)
        at javax.swing.TimerQueue.run(TimerQueue.java:236)
        - locked <0x12046428> (a javax.swing.TimerQueue)
        at java.lang.Thread.run(Thread.java:619)

"AWT-Windows" daemon prio=6 tid=0x05394000 nid=0xe5c runnable [0x06c2f000..0x06c2fbe8]
   java.lang.Thread.State: RUNNABLE
        at sun.awt.windows.WToolkit.eventLoop(Native Method)
        at sun.awt.windows.WToolkit.run(WToolkit.java:291)
        at java.lang.Thread.run(Thread.java:619)

"AWT-Shutdown" prio=6 tid=0x05391c00 nid=0x1c0 in Object.wait() [0x06a2f000..0x06a2fc68]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11ffbda0> (a java.lang.Object)
        at java.lang.Object.wait(Object.java:485)
        at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
        - locked <0x11ffbda0> (a java.lang.Object)
        at java.lang.Thread.run(Thread.java:619)

"Java2D Disposer" daemon prio=10 tid=0x05390c00 nid=0x1014 in Object.wait() [0x0682f000..0x0682fce8]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11ffbe30> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x11ffbe30> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at sun.java2d.Disposer.run(Disposer.java:125)
        at java.lang.Thread.run(Thread.java:619)

"Timer-0" daemon prio=6 tid=0x05111400 nid=0x16a4 in Object.wait() [0x0605f000..0x0605f9e8]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11facd88> (a java.util.TaskQueue)
        at java.util.TimerThread.mainLoop(Timer.java:509)
        - locked <0x11facd88> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:462)

"CLI Requests Server" daemon prio=6 tid=0x05110c00 nid=0x1090 runnable [0x05e5f000..0x05e5fae8]
   java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
        - locked <0x11face60> (a java.net.SocksSocketImpl)
        at java.net.ServerSocket.implAccept(ServerSocket.java:453)
        at java.net.ServerSocket.accept(ServerSocket.java:421)
        at org.netbeans.CLIHandler$Server.run(CLIHandler.java:1003)

"Active Reference Queue Daemon" daemon prio=2 tid=0x0506f400 nid=0x14b4 in Object.wait() [0x0537f000..0x0537fb68]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11facfe8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x11facfe8> (a java.lang.ref.ReferenceQueue$Lock)
        at org.netbeans.modules.openide.util.ActiveQueue.run(ActiveQueue.java:53)
        at java.lang.Thread.run(Thread.java:619)

"Low Memory Detector" daemon prio=6 tid=0x01c50c00 nid=0xcdc runnable [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"CompilerThread0" daemon prio=10 tid=0x01c50000 nid=0x11ac waiting on condition [0x00000000..0x04b7f690]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" daemon prio=10 tid=0x01c4f400 nid=0x1658 runnable [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x01c4c400 nid=0x1178 waiting on condition [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=0x01c30000 nid=0x14d8 in Object.wait() [0x0457f000..0x0457fae8]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11fad218> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x11fad218> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x01c2ec00 nid=0x1058 in Object.wait() [0x0437f000..0x0437fa68]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11facb78> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:485)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
        - locked <0x11facb78> (a java.lang.ref.Reference$Lock)

"main" prio=6 tid=0x01cfb800 nid=0x8bc waiting on condition [0x00000000..0x0022f260]
   java.lang.Thread.State: RUNNABLE

"VM Thread" prio=10 tid=0x01c2b800 nid=0x1694 runnable

"VM Periodic Task Thread" prio=10 tid=0x01c6b000 nid=0xf84 waiting on condition

JNI global references: 5648

Heap
 def new generation   total 7360K, used 6160K [0x10040000, 0x10830000, 0x11fa0000)
  eden space 6592K, 100% used [0x10040000, 0x106b0000, 0x106b0000)
  from space 768K,   0% used [0x106b0000, 0x106b04f0, 0x10770000)
  to   space 768K,   0% used [0x10770000, 0x10770000, 0x10830000)
 tenured generation   total 96660K, used 70856K [0x11fa0000, 0x17e05000, 0x29840000)
   the space 96660K,  73% used [0x11fa0000, 0x164d2008, 0x164d2200, 0x17e05000)
 compacting perm gen  total 47360K, used 47297K [0x29840000, 0x2c680000, 0x36040000)
   the space 47360K,  99% used [0x29840000, 0x2c670520, 0x2c670600, 0x2c680000)
No shared spaces configured.
Comment 1 Tomas Zezula 2010-01-04 07:20:20 UTC

*** This bug has been marked as a duplicate of bug 178999 ***