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.
During normal operations, it happens quite often that the IDE freezes and must be killed. In at least one circumstance, JConsole detected that the AWT Thread is blocked waiting for a lock. It *seems* (but I'm not sure) that this happens at the same time as a "Scanning projects" that automatically starts (and does not advance). Including the thread dump of the AWT Thread. Name: AWT-EventQueue-1 State: WAITING on java.util.concurrent.locks.ReentrantLock$FairSync@774aeb6a owned by: Parsing & Indexing Loop (201102140001) Total blocked: 132,885 Total waited: 135,217 Stack trace: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811) java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842) java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178) java.util.concurrent.locks.ReentrantLock$FairSync.lock(ReentrantLock.java:201) java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262) org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:190) org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106) org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:432) org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:403) org.netbeans.modules.jmx.JavaModelHelper.getFullClassName(JavaModelHelper.java:3347) org.netbeans.modules.jmx.JavaModelHelper.isStandardMBean(JavaModelHelper.java:3430) org.netbeans.modules.jmx.JavaModelHelper.getManagementInterface(JavaModelHelper.java:3399) org.netbeans.modules.jmx.JavaModelHelper.canUpdateAttributesOrOperations(JavaModelHelper.java:3718) org.netbeans.modules.jmx.actions.AddAttrAction.enable(AddAttrAction.java:92) org.openide.util.actions.NodeAction$DelegateAction.resultChanged(NodeAction.java:615) org.openide.util.actions.NodeAction$DelegateAction.<init>(NodeAction.java:560) org.openide.util.actions.NodeAction.createContextAwareInstance(NodeAction.java:357) org.netbeans.modules.editor.NbEditorKit.translateContextLookupAction(NbEditorKit.java:338) org.netbeans.modules.editor.NbEditorKit.access$200(NbEditorKit.java:135) org.netbeans.modules.editor.NbEditorKit$LayerSubFolderMenu.addAction(NbEditorKit.java:901) org.netbeans.modules.editor.NbEditorKit$LayerSubFolderMenu.<init>(NbEditorKit.java:823) org.netbeans.modules.editor.NbEditorKit$LayerSubFolderMenu.<init>(NbEditorKit.java:801) org.netbeans.modules.editor.NbEditorKit$NbBuildPopupMenuAction.buildPopupMenu(NbEditorKit.java:425) org.netbeans.editor.ext.ExtKit$BuildPopupMenuAction.actionPerformed(ExtKit.java:285) org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:339) org.openide.awt.AlwaysEnabledAction$1.run(AlwaysEnabledAction.java:137) org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:95) org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116) org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99) org.openide.awt.AlwaysEnabledAction.actionPerformed(AlwaysEnabledAction.java:140) org.netbeans.editor.EditorUI.showPopupMenu(EditorUI.java:1764) org.netbeans.editor.EditorUI$7.run(EditorUI.java:1697) java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) java.awt.EventQueue.dispatchEvent(EventQueue.java:597) org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148) java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Created attachment 106221 [details] Thread Dump Added full thread dump taken with jstack.
Some threads are waiting on parsing API lock which is acquired by Parsing & Indexing Thread. The Parsing & Indexing Thread plus some other threads are blocked by logging. Here is the stack trace: "Parsing & Indexing Loop (201102140001)" prio=10 tid=0x00007fca5d32a800 nid=0x2896 waiting on condition [0x00007fca50bd1000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00007fca7cecde78> (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:1987) at java.util.concurrent.LinkedBlockingQueue.put(LinkedBlockingQueue.java:306) at org.netbeans.core.startup.TopLogging$NonClose.publish(TopLogging.java:500) at java.util.logging.Logger.log(Logger.java:458) at java.util.logging.Logger.doLog(Logger.java:480) at java.util.logging.Logger.log(Logger.java:503) at java.util.logging.Logger.info(Logger.java:1022) at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork.scanSources(RepositoryUpdater.java:3361)
Is it real freeze? I can see the "Logging Flush" daemon prio=10 tid=0x0000000042a77800 nid=0x3097 runnable [0x00007fca50fd4000] java.lang.Thread.State: RUNNABLE at java.io.FileOutputStream.writeBytes(Native Method) at java.io.FileOutputStream.write(FileOutputStream.java:260) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105) - locked <0x00007fca7cecb710> (a java.io.BufferedOutputStream) at java.io.PrintStream.write(PrintStream.java:430) - locked <0x00007fca7cecb6d8> (a java.io.PrintStream) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202) at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106) - locked <0x00007fca7cc22770> (a java.io.OutputStreamWriter) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:203) at java.io.Writer.write(Writer.java:140) at java.util.logging.StreamHandler.publish(StreamHandler.java:192) - locked <0x00007fca7cc226f0> (a java.util.logging.StreamHandler) at org.netbeans.core.startup.TopLogging$NonClose.run(TopLogging.java:569) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968) is not blocked and may soon clean the log buffer that blocks parsing API. Are not you just logging too much, Fabrizio?
Hi Jarda. I can say that after ten minutes it was still not responding (clicking anywhere, or trying to invoke a menu, was not effective). Even clicking on the "close window" icon of the windowing system didn't have any effect. I had to kill it by means of the command line. The logging session is strange, though. Is it the standard stuff in $HOME/.netbeans/7.0b2/var/log? I don't see lots of log files and BTW I didn't change the log configuration. I'll look at this at next occurrence of the bug (I didn't work with NetBeans in the past days).
I have to admit, I can't imagine what is wrong. Looking at http://hg.netbeans.org/ergonomics/file/0bb16d5e3777/core.startup/src/org/netbeans/core/startup/TopLogging.java I see that the queue is full (1000 records, e.g. the system is logging like crazy). The queue is supposed to be freed by "Logging Flush" thread. However that one is running fine (its locks are not needed by anyone else) and it seems to correctly write to var/log/messages.log... Fabricio, what about CPU? If the system is logging too much, it would be very high. With deadlock it would be down to 0%. Meanwhile closing.
Didn't reproduce so far. I agree with closing it for now. Should I reproduce it, I'll reopen this.
so verified