aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes deadlock involving AWT-XAWT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "deadlock involving AWT-XAWT" Watch "deadlock involving AWT-XAWT" New topic
Author

deadlock involving AWT-XAWT

sarvesh meens
Ranch Hand

Joined: Mar 31, 2006
Posts: 43

hi all,
In our application,a custom printStream is set as the error stream.
In custom printStream,println(..) methods are ove-ridden to pop a non-modal dialog after logging the error.
The application has been running for 240+ hours.
Then a deadlock is observed.
The thread-dump looks like this.

Full thread dump Java HotSpot(TM) Client VM (1.5.0_08-b03 mixed mode, sharing):

"Swing updater" prio=1 tid=0x082b8a98 nid=0x1c7e runnable [0xb0588000..0xb0588fb0]
at com.midas.corVAN.diag.SysDiagView$SwingUpdater.run(SysDiagView.java:459)

"Swing updater" prio=1 tid=0x0807cca8 nid=0x1c7d runnable [0xb0609000..0xb060a030]
at com.midas.corVAN.bsdTopology.DeviceDataListener$SwingUpdater.run(DiuNode.java:235)

"TimerQueue" daemon prio=1 tid=0x082f1a58 nid=0x1c77 in Object.wait() [0xb0a39000..0xb0a39eb0]
at java.lang.Object.wait(Native Method)
- waiting on <0x7e006df0> (a javax.swing.TimerQueue)
at javax.swing.TimerQueue.run(TimerQueue.java:233)
- locked <0x7e006df0> (a javax.swing.TimerQueue)
at java.lang.Thread.run(Thread.java:595)
DestroyJavaVM" prio=1 tid=0x0805dac0 nid=0x1c64 waiting on condition [0x00000000..0xbfffd040]

"TrapRecvCls_Thread" prio=1 tid=0x08481d60 nid=0x1c72 waiting for monitor entry [0xb088e000..0xb088f130]
at sun.misc.Unsafe.monitorEnter(Native Method)
at sun.awt.X11.XToolkit.awtLock(XToolkit.java:191)
at sun.awt.X11.WindowPropertyGetter.execute(WindowPropertyGetter.java:60)
at sun.awt.X11.WindowPropertyGetter.execute(WindowPropertyGetter.java:53)
at sun.awt.X11.XAtom.getAtomData(XAtom.java:374)
at sun.awt.X11.XWM.setMotifDecor(XWM.java:798)
at sun.awt.X11.XWM.setShellDecor(XWM.java:847)
at sun.awt.X11.XDecoratedPeer.setVisible(XDecoratedPeer.java:637)
at sun.awt.X11.XDialogPeer.setVisible(XDialogPeer.java:68)
at sun.awt.X11.XComponentPeer.show(XComponentPeer.java:452)
at java.awt.Dialog.conditionalShow(Dialog.java:451)
- locked <0x7ddeab40> (a java.awt.Component$AWTTreeLock)
at java.awt.Dialog.show(Dialog.java:488)
at java.awt.Component.show(Component.java:1300)
at java.awt.Component.setVisible(Component.java:1253)
at com.midas.corVAN.global.ErrorStream.println(ErrorStream.java:164)
at java.lang.Throwable.printStackTrace(Throwable.java:462)
- locked <0x7de5d538> (a com.midas.corVAN.global.ErrorStream) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:978)
at java.lang.Thread.dispatchUncaughtException(Thread.java:1778)

"Message Receiving Thread" prio=1 tid=0x08481778 nid=0x1c71 waiting for monitor entry [0xb090f000..0xb09101b0]
at java.io.PrintStream.write(PrintStream.java:455)
- waiting to lock <0x7de5d538> (a com.midas.corVAN.global.ErrorStream)
at java.io.PrintStream.print(PrintStream.java:602)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:985)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:978)
at java.lang.Thread.dispatchUncaughtException(Thread.java:1778)

"invokeFromDiag - appNo 551" prio=1 tid=0x08449428 nid=0x1c6f waiting for monitor entry [0xb0aba000..0xb0abaeb0]
at sun.awt.X11.XAwtState.getComponentMouseEntered(XAwtState.java:40)
- waiting to lock <0x9135a4a0> (a java.lang.Class)
at sun.awt.X11.XGlobalCursorManager.findHeavyweightUnderCursor(XGlobalCursorManager.java:102)
at sun.awt.X11.XGlobalCursorManager.findHeavyweightUnderCursor(XGlobalCursorManager.java:118)
at sun.awt.GlobalCursorManager._updateCursor(GlobalCursorManager.java:166)
at sun.awt.GlobalCursorManager.updateCursorImmediately(GlobalCursorManager.java:82)
at sun.awt.X11.XComponentPeer.updateCursorImmediately(XComponentPeer.java:816)
at java.awt.Component.updateCursorImmediately(Component.java:2569)
at java.awt.Container.validate(Container.java:1457)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

"AWT-Shutdown" prio=1 tid=0x08438978 nid=0x1c6e in Object.wait() [0xb0b3b000..0xb0b3bf30]
at java.lang.Object.wait(Native Method)
- waiting on <0x7de26278> (a java.lang.Object)
at java.lang.Object.wait(Object.java:474)
at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
- locked <0x7de26278> (a java.lang.Object)
at java.lang.Thread.run(Thread.java:595)"Java2D Disposer" daemon prio=1 tid=0x083f2190 nid=0x1c6c waiting for monitor entry [0xb0c5e000..0xb0c5f030]
at sun.java2d.DefaultDisposerRecord.invokeNativeDispose(Native Method)
at sun.java2d.DefaultDisposerRecord.dispose(DefaultDisposerRecord.java:24)
at sun.java2d.Disposer.run(Disposer.java:109)
at java.lang.Thread.run(Thread.java:595)

"Low Memory Detector" daemon prio=1 tid=0x080a6590 nid=0x1c6a runnable [0x00000000..0x00000000]

"CompilerThread0" daemon prio=1 tid=0x080a4fe8 nid=0x1c69 waiting on condition [0x00000000..0xb2279b98]
"Signal Dispatcher" daemon prio=1 tid=0x080a4110 nid=0x1c68 runnable [0x00000000..0x00000000]

"Finalizer" daemon prio=1 tid=0x0809d6c8 nid=0x1c67 waiting for monitor entry [0xb257b000..0xb257beb0]
at sun.awt.X11InputMethod.disposeXIC(Native Method)
at sun.awt.X11InputMethod.disposeImpl(X11InputMethod.java:650)
- locked <0x7e231468> (a sun.awt.X11.XInputMethod)
at sun.awt.X11.XInputMethod.disposeImpl(XInputMethod.java:99)
- locked <0x7e231468> (a sun.awt.X11.XInputMethod)
at sun.awt.X11InputMethod.dispose(X11InputMethod.java:677)
at sun.awt.X11InputMethod.finalize(X11InputMethod.java:155)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)

"Reference Handler" daemon prio=1 tid=0x0809c9d8 nid=0x1c66 in Object.wait() [0xb25fc000..0xb25fcf30]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:474)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x7dde07c8> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=1 tid=0x08099df0 nid=0x1c65 runnable

"VM Periodic Task Thread" prio=1 tid=0x080c1368 nid=0x1c6b waiting on condition
Found one Java-level deadlock:
=============================
"TrapRecvCls_Thread":
waiting to lock monitor 0x0809e65c (object 0x9135a4a0, a java.lang.Class)
in JNI, which is held by "AWT-XAWT"
"AWT-XAWT":
waiting to lock monitor 0x0809e69c (object 0x7de5d538, a com.midas.corVAN.global.ErrorStream),
which is held by "TrapRecvCls_Thread"
Java stack information for the threads listed above:
===================================================
"TrapRecvCls_Thread":
at sun.misc.Unsafe.monitorEnter(Native Method)
at sun.awt.X11.XToolkit.awtLock(XToolkit.java:191)
at sun.awt.X11.WindowPropertyGetter.execute(WindowPropertyGetter.java:60)
at sun.awt.X11.WindowPropertyGetter.execute(WindowPropertyGetter.java:53)
at sun.awt.X11.XAtom.getAtomData(XAtom.java:374)
at sun.awt.X11.XWM.setMotifDecor(XWM.java:798)
at sun.awt.X11.XWM.setShellDecor(XWM.java:847)
at sun.awt.X11.XDecoratedPeer.setVisible(XDecoratedPeer.java:637)
at sun.awt.X11.XDialogPeer.setVisible(XDialogPeer.java:68)
at sun.awt.X11.XComponentPeer.show(XComponentPeer.java:452)
at java.awt.Dialog.conditionalShow(Dialog.java:451)
- locked <0x7ddeab40> (a java.awt.Component$AWTTreeLock)
at java.awt.Dialog.show(Dialog.java:488)
at java.awt.Component.show(Component.java:1300)
at java.awt.Component.setVisible(Component.java:1253)
at com.midas.corVAN.global.ErrorStream.println(ErrorStream.java:164)
at java.lang.Throwable.printStackTrace(Throwable.java:462)
- locked <0x7de5d538> (a com.midas.corVAN.global.ErrorStream)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:987)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:978)
at java.lang.Thread.dispatchUncaughtException(Thread.java:1778)
"AWT-XAWT":
at java.io.PrintStream.println(PrintStream.java:738)
- waiting to lock <0x7de5d538> (a com.midas.corVAN.global.ErrorStream)
at com.midas.corVAN.global.ErrorStream.println(ErrorStream.java:192)
at sun.awt.X11.XToolkit.processException(XToolkit.java:414)
at sun.awt.X11.XToolkit.callTimeoutTasks(XToolkit.java:1345)
at sun.awt.X11.XToolkit.run(XToolkit.java:462)
at sun.awt.X11.XToolkit.run(XToolkit.java:438)
at java.lang.Thread.run(Thread.java:595)
Found 1 deadlock.


What could be wrong?

The problem is not frequent and there is no clear methodology to simulate it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deadlock involving AWT-XAWT