JDK-6903893 : Fix failed for CR 6834576: RemoveChild/ test fail with deadlock on rhel and sles
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2009-11-23
  • Updated: 2011-01-19
  • Resolved: 2009-12-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b78Fixed
Related Reports
Duplicate :  
Relates :  
Description
Fix for 6834576 has failed with deadlock on rhel and sles.

"AWT-EventQueue-0":
        at java.awt.Component.invalidate(Component.java:2811)
        - waiting to lock <0xb40aee98> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.invalidate(Container.java:1515)
        at java.awt.Window.dispatchEventImpl(Window.java:2608)
        at java.awt.Component.dispatchEvent(Component.java:4527)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:286)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:191)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:139)
"AppletThread":
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0xb40b8b50> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:867)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197)
        at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:214)
        at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:290)
        at sun.awt.SunToolkit.awtLock(SunToolkit.java:273)
        at sun.awt.X11.XToolkit.initializeMultiClickTime(XToolkit.java:1278)
        at sun.awt.X11.XToolkit.getMultiClickTime(XToolkit.java:1273)
        at sun.awt.X11.XToolkit.initializeDesktopProperties(XToolkit.java:1447)
        at java.awt.Toolkit.getDesktopProperty(Toolkit.java:1784)
        - locked <0xb40d6b18> (a sun.awt.X11.XToolkit)
        at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:138)
        at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1557)
        at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:147)
        at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1592)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:549)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:589)
        at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1345)
        at javax.swing.UIManager.initialize(UIManager.java:1434)
        at javax.swing.UIManager.maybeInitialize(UIManager.java:1422)
        - locked <0xb419b568> (a java.lang.Object)
        at javax.swing.UIManager.getDefaults(UIManager.java:663)
        at javax.swing.UIManager.getColor(UIManager.java:705)
        at com.sun.java.swing.plaf.motif.MotifBorders$BevelBorder.<init>(MotifBorders.java:60)
        at com.sun.java.swing.plaf.motif.MotifLookAndFeel.initComponentDefaults(MotifLookAndFeel.java:209)
        at sun.awt.X11.XAWTLookAndFeel.initComponentDefaults(XAWTLookAndFeel.java:86)
        at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:147)
        at sun.awt.X11.XToolkit.initUIDefaults(XToolkit.java:264)
        at sun.awt.X11.XToolkit.getUIDefaults(XToolkit.java:244)
        at sun.awt.X11.XScrollPanePeer.<clinit>(XScrollPanePeer.java:47)
        at sun.awt.X11.XToolkit.createScrollPane(XToolkit.java:997)
        at java.awt.ScrollPane.addNotify(ScrollPane.java:560)
        - locked <0xb40aee98> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.addImpl(Container.java:1102)
        - locked <0xb40aee98> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.add(Container.java:398)
        at ScrollPaneRemoveAdd.init(ScrollPaneRemoveAdd.java:49)
        at com.sun.javatest.regtest.AppletWrapper$AppletRunnable.run(AppletWrapper.java:150)
        at java.lang.Thread.run(Thread.java:717)
"AWT-XAWT":
        at sun.awt.X11.XToolkit.getNumberOfButtonsImpl(Native Method)
        - waiting to lock <0xb40d6b18> (a sun.awt.X11.XToolkit)
        at sun.awt.X11.XToolkit.getNumberOfButtons(XToolkit.java:1467)
        at java.awt.event.MouseEvent.<clinit>(MouseEvent.java:396)
        at sun.awt.X11.XWindow.handleXCrossingEvent(XWindow.java:986)
        at sun.awt.X11.XBaseWindow.dispatchEvent(XBaseWindow.java:1110)
        at sun.awt.X11.XBaseWindow.dispatchToWindow(XBaseWindow.java:1070)
        at sun.awt.X11.XToolkit.dispatchEvent(XToolkit.java:541)
        at sun.awt.X11.XToolkit.run(XToolkit.java:650)
        at sun.awt.X11.XToolkit.run(XToolkit.java:571)
        at java.lang.Thread.run(Thread.java:717)

Found 1 deadlock.

Comments
EVALUATION The deadlock is between Applet (owns toolkit lock and attempt to acquire awtLock) and the toolkit threads (opposite order). The toolkit thread require it just because it's about to query the number of buttons from the X system and it already owns awtlock. By some reason, its native method has synchronized modifier but shouldn't. We couldn't find the environment to test it yet.
23-11-2009

SUGGESTED FIX +++ b/src/solaris/classes/sun/awt/X11/XToolkit.java Mon Nov 23 13:54:40 2009 +0300 @@ -1455,7 +1455,7 @@ public final class XToolkit extends UNIX * (which is assigned to the virtual pointer) reports the maximum * capabilities of the mouse pointer (i.e. 32 physical buttons). */ - private native synchronized int getNumberOfButtonsImpl(); + private native int getNumberOfButtonsImpl(); @Override public int getNumberOfButtons(){
23-11-2009