Originally reported in NetBeans bug tracking system:
http://www.netbeans.org/issues/show_bug.cgi?id=148868
One of NetBeans users running on Open Solaris x86 with JDK 1.5.0_16 reports that from time to time, following deadlock in X11GraphicsConfig occurs:
Found one Java-level deadlock:
=============================
"AWT-EventQueue-1":
waiting to lock monitor 0x0811ec54 (object 0xd6eeaa80, a java.lang.Class)
in JNI, which is held by "AWT-Motif"
"AWT-Motif":
waiting to lock monitor 0x0811ef14 (object 0xadd93360, a sun.awt.X11GraphicsConfig),
which is held by "AWT-EventQueue-1"
Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-1":
at sun.awt.X11GraphicsConfig.makeColorModel(Native Method)
at sun.awt.X11GraphicsConfig.getColorModel(X11GraphicsConfig.java:249)
- locked <0xadd93360> (a sun.awt.X11GraphicsConfig)
at sun.awt.motif.X11VolatileSurfaceManager.initAcceleratedSurface(X11VolatileSurfaceManager.java:67)
at sun.awt.image.VolatileSurfaceManager.initialize(VolatileSurfaceManager.java:85)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:58)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:67)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:85)
at sun.awt.X11GraphicsConfig.createCompatibleVolatileImage(X11GraphicsConfig.java:195)
at javax.swing.RepaintManager.getVolatileOffscreenBuffer(RepaintManager.java:597)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4911)
at javax.swing.JComponent.paint(JComponent.java:996)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1709)
at org.netbeans.core.windows.view.ui.MainWindow.paint(MainWindow.java:577)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
at sun.awt.RepaintArea.paint(RepaintArea.java:224)
at sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:395)
at java.awt.Component.dispatchEventImpl(Component.java:4060)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Window.dispatchEventImpl(Window.java:1791)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
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-Motif":
at sun.awt.X11GraphicsConfig.getSurfaceType(X11GraphicsConfig.java:143)
- waiting to lock <0xadd93360> (a sun.awt.X11GraphicsConfig)
at sun.awt.X11SurfaceData.createData(X11SurfaceData.java:322)
at sun.awt.X11GraphicsConfig.createSurfaceData(X11GraphicsConfig.java:380)
at sun.awt.motif.MComponentPeer.validateSurface(MComponentPeer.java:912)
at sun.awt.motif.MWindowPeer.handleResize(MWindowPeer.java:220)
at sun.awt.motif.MToolkit.run(Native Method)
at java.lang.Thread.run(Thread.java:595)
Found 1 deadlock.
------------------------
Problem is hard to reproduce, as usual in threading issues. Full thread dump is in attachment.