Deadlocks in JConsole when pasting
[email protected] Wed, 18 Aug 2004 14:41:45 -0400
| Newsgroups | gmane.comp.java.beanshell.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
A deadlock occurs in the JConsole when pasting and then attempting to
execute scripts that exceed some relatively small length. A thread
stack dump immediately shows the problem:
"AWT-EventQueue-0" prio=7 tid=0x00772250 nid=0x192 in Object.wait()
[18ecf000..18ecfd90]
at java.lang.Object.wait(Native Method)
- waiting on <0x105eab30> (a java.io.PipedInputStream)
at java.io.PipedInputStream.receive(PipedInputStream.java:149)
- locked <0x105eab30> (a java.io.PipedInputStream)
at java.io.PipedInputStream.receive(PipedInputStream.java:176)
- locked <0x105eab30> (a java.io.PipedInputStream)
at java.io.PipedOutputStream.write(PipedOutputStream.java:129)
at java.io.OutputStream.write(OutputStream.java:58)
at bsh.util.JConsole.acceptLine(Unknown Source)
at bsh.util.JConsole.enter(Unknown Source)
at bsh.util.JConsole.type(Unknown Source)
- locked <0x105e75e8> (a bsh.util.JConsole)
at bsh.util.JConsole.keyPressed(Unknown Source)
at java.awt.Component.processKeyEvent(Component.java:5058)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2388)
at java.awt.Component.processEvent(Component.java:4909)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at
java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
at
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:627)
at
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:831)
at
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:741)
at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:592)
at java.awt.Component.dispatchEventImpl(Component.java:3506)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
It shows that PipedInput and PipedOutput streams are deadlocked within
the EventQueue thread. As per the Java API, having a PipedInputReader
read from a PipedOutputWriter in the same thread is prone to causing
deadlocks, and does for me on a consistent basis.
Cheers,
Raman
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285