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 34086 - Deadlock on shutdown if a property editor showing
Summary: Deadlock on shutdown if a property editor showing
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@debugger
URL:
Keywords: ARCH, THREAD
Depends on:
Blocks:
 
Reported: 2003-06-02 12:16 UTC by _ tboudreau
Modified: 2010-04-29 09:13 UTC (History)
3 users (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 _ tboudreau 2003-06-02 12:16:00 UTC
Fully reproducable.  With new property sheet impl...

Open Tools | Options | Debugging and Executing |
Debugger Execution
Select the Library Path property in the property sheet
Shut down the IDE.  The main window no longer
paints and
shutdown never happens.

The trigger seems to be:
org.netbeans.core.execution.beaninfo.editors.NbClassPathEditor
-
something during shutdown triggers a repaint of
the property
sheet.  This tries to fetch all of the module
jars, at the
same time the window system is writing its XML
out.  See line
270 of org.netbeans.core.windows.PersistenceManager:

// FIXME There shouldn't be used this kind of hack.
// wait for all deferred tasks and for task saving
winsys
while
(DeferredPerformer.getDefault().isProcessing() ||
!isWriteFinished()) {
                    Thread.currentThread().sleep(200);
                }

If org.openide.LifecycleManager were enhanced so
that I could
listen for a shutdown event (or fetch some kind of
state flag),
I could avoid the repaint.  But probably the
underlying problem
should be fixed, either in the way the classpath
editor retrieves
values from getTags() (some caching or something),
or the 
window system's behavior on shutdown.  Adding
Peter Zavadsky to
cc to see if the current window system work will
clear this
problem.

Stack trace below.



"Default RequestProcessor" daemon prio=1
tid=0x00983e60 nid=0xa4 waiting on condition
[e067f000..e067fc30]
        at java.lang.Thread.sleep(Native Method)
        at
org.netbeans.core.windows.PersistenceManager.writeXMLWaiting(PersistenceManager.java:271)
        at
org.netbeans.core.windows.WindowSystemImpl.save(WindowSystemImpl.java:55)
        at
org.netbeans.core.NbTopManager$1.run(NbTopManager.java:463)
        at
org.netbeans.core.modules.ModuleManager.shutDown(ModuleManager.java:1496)
        at
org.netbeans.core.modules.ModuleSystem.shutDown(ModuleSystem.java:328)
        at
org.netbeans.core.NbTopManager.exit(NbTopManager.java:473)
        at
org.netbeans.core.NbTopManager$NbLifecycleManager.exit(NbTopManager.java:534)
        at
org.netbeans.core.actions.SystemExit.run(SystemExit.java:61)
        at org.openide.util.Task.run(Task.java:136)
        at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
        at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:677)

"Compilation" daemon prio=2 tid=0x0079e9f8
nid=0x24 in Object.wait() [e0eff000..e0effc30]
        at java.lang.Object.wait(Native Method)
        - waiting on <0xec367988> (a
java.util.LinkedList)
        at java.lang.Object.wait(Object.java:429)
        at
org.netbeans.core.compiler.CompilationEngineImpl$CompilerThread.nextJobAndTask(CompilationEngineImpl.java:162)
        - locked <0xec367988> (a java.util.LinkedList)
        at
org.netbeans.core.compiler.CompilationEngineImpl$CompilerThread.run(CompilationEngineImpl.java:175)

"TimerQueue" daemon prio=5 tid=0x002969e8 nid=0x15
in Object.wait() [e0c7f000..e0c7fc30]
        at java.lang.Object.wait(Native Method)
        at
javax.swing.TimerQueue.run(TimerQueue.java:231)
        - locked <0xeb784408> (a
javax.swing.TimerQueue)
        at java.lang.Thread.run(Thread.java:534)

"Java2D Disposer" daemon prio=10 tid=0x003aa6c8
nid=0x12 in Object.wait() [e7aff000..e7affc30]
        at java.lang.Object.wait(Native Method)
        at
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
        - locked <0xeb2caf40> (a
java.lang.ref.ReferenceQueue$Lock)
        at
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
        at sun.java2d.Disposer.run(Disposer.java:100)
        at java.lang.Thread.run(Thread.java:534)

"AWT-EventQueue-0" prio=5 tid=0x0038ec38 nid=0x11
in Object.wait() [e7bfc000..e7bffc30]
        at java.lang.Object.wait(Native Method)
        - waiting on <0xea1fe8f8> (a
org.openide.util.Mutex$QueueCell)
        at java.lang.Object.wait(Object.java:429)
        at
org.openide.util.Mutex$QueueCell.sleep(Mutex.java:1172)
        - locked <0xea1fe8f8> (a
org.openide.util.Mutex$QueueCell)
        at
org.openide.util.Mutex.enter(Mutex.java:486)
        at
org.openide.util.Mutex.readEnter(Mutex.java:403)
        at
org.openide.util.Mutex.access$000(Mutex.java:66)
        at
org.openide.util.Mutex$Privileged.enterReadAccess(Mutex.java:1217)
        at
org.netbeans.core.modules.ModuleSystem.getModuleJars(ModuleSystem.java:130)
        at
org.netbeans.core.execution.ExecutionEngine.createLibraryPath(ExecutionEngine.java:169)
        at
org.openide.execution.NbClassPath.createLibraryPath(NbClassPath.java:143)
        at
org.openide.execution.ProcessExecutor.getLibraryPath(ProcessExecutor.java:150)
        at
sun.reflect.GeneratedMethodAccessor84.invoke(Unknown
Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at
java.lang.reflect.Method.invoke(Method.java:324)
        at
org.openide.nodes.PropertySupport$Reflection.getValue(PropertySupport.java:187)
        at
org.netbeans.modules.settings.convertors.SerialDataNode$P.getValue(SerialDataNode.java:613)
        at
org.openide.explorer.propertysheet.PropUtils.updateEdFromProp(PropUtils.java:558)
        at
org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:530)
        at
org.openide.explorer.propertysheet.ReusablePropertyModel.getPropertyEditor(ReusablePropertyModel.java:57)
        at
org.openide.explorer.propertysheet.SheetCellRenderer.setCurrentModelAndEnv(SheetCellRenderer.java:291)
        at
org.openide.explorer.propertysheet.SheetCellRenderer.getTableCellRendererComponent(SheetCellRenderer.java:82)
        at
javax.swing.JTable.prepareRenderer(JTable.java:3731)
        at
javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
        at
javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
        at
javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
        at
javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
        at
javax.swing.JComponent.paintComponent(JComponent.java:541)
        at
javax.swing.JComponent.paint(JComponent.java:808)
        at
org.openide.explorer.propertysheet.SheetTable.paint(SheetTable.java:449)
        at
javax.swing.JComponent.paintChildren(JComponent.java:647)
        - locked <0xeb3b3b48> (a
java.awt.Component$AWTTreeLock)
        at
javax.swing.JComponent.paint(JComponent.java:817)
        at
javax.swing.JViewport.paint(JViewport.java:722)
        at
org.openide.explorer.propertysheet.PropertySheet$MarginViewport.paint(PropertySheet.java:1303)
        at
javax.swing.JComponent.paintChildren(JComponent.java:647)
        - locked <0xeb3b3b48> (a
java.awt.Component$AWTTreeLock)
        at
javax.swing.JComponent.paint(JComponent.java:817)
        at
javax.swing.JComponent.paintChildren(JComponent.java:647)
        - locked <0xeb3b3b48> (a
java.awt.Component$AWTTreeLock)
        at
javax.swing.JComponent.paint(JComponent.java:817)
        at
javax.swing.JComponent.paintChildren(JComponent.java:647)
        - locked <0xeb3b3b48> (a
java.awt.Component$AWTTreeLock)
        at
javax.swing.JComponent.paint(JComponent.java:817)
        at
javax.swing.JComponent.paintChildren(JComponent.java:647)
        - locked <0xeb3b3b48> (a
java.awt.Component$AWTTreeLock)
        at
javax.swing.JComponent.paint(JComponent.java:817)
        at
org.netbeans.core.windows.frames.PerimeterPane.paint(PerimeterPane.java:103)
        at
javax.swing.JComponent.paintChildren(JComponent.java:647)
        - locked <0xeb3b3b48> (a
java.awt.Component$AWTTreeLock)
        at
javax.swing.JComponent.paint(JComponent.java:817)
        at
javax.swing.JComponent.paintChildren(JComponent.java:647)
        - locked <0xeb3b3b48> (a
java.awt.Component$AWTTreeLock)
Comment 1 Jesse Glick 2003-06-02 16:23:17 UTC
At least part of the fault is in the debugger. Maybe debuggercore but
maybe debuggerjpda - DebuggerExecutor should not be using
NbClassPath.libraryPath as this usage is deprecated. If it didn't have
this obsolete property, there would be no deadlock here.
Comment 2 Maros Sandor 2004-01-07 10:07:08 UTC
I cannot reproduce it, please verify that this has been fixed or 
provide more detailed test case.
Comment 3 _ tboudreau 2004-01-07 10:26:59 UTC
Can't reproduce in the current trunk, closing.
Comment 4 Jesse Glick 2004-01-07 17:30:00 UTC
Though DebuggerExecutor *still* shouldn't be using
NbClassPath.getLibraryPath().
Comment 5 Milan Kubec 2004-01-09 12:19:14 UTC
If usage of deprecated method can potentially cause deadlock, please
remove it if it's possible.

Removing INCOMPLETE, because threading issue like this can be hardly
complete.
Comment 6 Jesse Glick 2004-01-09 18:03:33 UTC
Best thing to start with would be to remove all references to the
libraryPath from the GUI, including the *BeanInfo and the format help
for the tags. It is long obsolete and should not be shown to users.

PersistenceManager.writeXMLWaiting is gone - can anyone still
reproduce this deadlock?

If necessary ModuleSystem.getModuleJars could probably be written to
not block on the module system mutex.
Comment 7 Maros Sandor 2004-01-21 09:54:25 UTC
Needs redesign, deprecated api will dissapear in promo-D.
Comment 8 Milan Kubec 2004-02-05 10:22:05 UTC
Removing fix-in-36 if it's planned for promo-D.
Comment 9 Jan Jancura 2004-05-31 13:21:33 UTC
fixed in the main trunk
Comment 10 Quality Engineering 2010-04-29 09:13:42 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.