Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5006427

REGRESSION: Deadlock when opening multiple dialogs

XMLWordPrintable

    • b45
    • x86
    • linux, linux_redhat_9.0

      dalStrategy.java:86)
              at sun.awt.X11.XTransientForModality.setModal(XTransientForModality.java:35)
              at sun.awt.X11.XMWMModality.setModal(XMWMModality.java:72)
              at sun.awt.X11.XNETProtocol.setModal(XNETProtocol.java:207)
              at sun.awt.X11.XDialogPeer.handleMapNotifyEvent(XDialogPeer.java:87)
              at sun.awt.X11.XBaseWindow.dispatchEvent(XBaseWindow.java:813)
              at sun.awt.X11.XWindowPeer.dispatchEvent(XWindowPeer.java:437)
              at sun.awt.X11.XBaseWindow.dispatchToWindow(XBaseWindow.java:766)
              at sun.awt.X11.XToolkit.dispatchEvent(XToolkit.java:394)
              at sun.awt.X11.XToolkit.run(XToolkit.java:493)
              at sun.awt.X11.XToolkit.run(XToolkit.java:438)
              at java.lang.Thread.run(Thread.java:570)
       
      Found 1 deadlock.
       

      ###@###.### 2004-03-02

      J2SE Version (please include all output from java -version flag):
        java version "1.5.0-beta2"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b40)
        Java HotSpot(TM) Client VM (build 1.5.0-beta2-b40, mixed mode)

      Does this problem occur on J2SE 1.3.x or 1.4.x? Yes / No (pick one)
        No. works fine with 1.4.2_03.

      Operating System Configuration Information (be specific):
        Debian Linux SID, XFree 4.3.0, Kernel 2.4 and Kernel 2.6

      Hardware Configuration Information (be specific):
        Dell Inspiron 8500 with 1GB RAM.

      Bug Description:
        When more than one modal dialogs are opened there is a chance that an
        AWT deadlock occurs. The attached program repeatedly displays up to 10
        modal dialogs and closes them again. This program the deadlock after a
        short while.

        With JDK 1.4.2_03 no deadlock occurs.

        This is critical because it causes the application to hang. No
        any potential workaround.


      Steps to Reproduce (be specific):
        Run the attached Java program(DialogDeadlockTest.java)
        until it hangs (deadlocks). Capturing a thread dump yields
        stacktraces and a deadlock.

      Thread dump and stacktraces info:
      ----------------------------------
      hans@gna:~/CodeGuideProjects/DialogDeadlockTest$ /opt/java/j2sdk1.5.0/bin/java DialogDeadlockTest
      Full thread dump Java HotSpot(TM) Client VM (1.5.0-beta2-b40 mixed mode):
       
      "DestroyJavaVM" prio=1 tid=0x0805ab68 nid=0x48c waiting on condition [0x00000000..0xbfffd5f0]
       
      "AWT-EventQueue-0" prio=1 tid=0x0817a4c0 nid=0x49a waiting for monitor entry
      [0xbe1fe000..0xbe1ff4f4]
              at sun.awt.X11.XComponentPeer.restack(XComponentPeer.java:1364)
              - waiting to lock <0x52031158> (a java.lang.Class)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Component.addNotify(Component.java:5873)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Container.addNotify(Container.java:2486)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at javax.swing.JComponent.addNotify(JComponent.java:4407)
              at javax.swing.JRootPane.addNotify(JRootPane.java:676)
              at java.awt.Container.addNotify(Container.java:2493)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Window.addNotify(Window.java:458)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Dialog.addNotify(Dialog.java:376)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Window.pack(Window.java:476)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:37)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              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=0x08159f78 nid=0x498 in Object.wait() [0xbe3ff000..0xbe3ff574]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x49c7e1d0> (a java.lang.Object)
              at java.lang.Object.wait(Object.java:474)
              at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
              - locked <0x49c7e1d0> (a java.lang.Object)
              at java.lang.Thread.run(Thread.java:570)
       
      "AWT-XAWT" daemon prio=1 tid=0x08154378 nid=0x497 waiting for monitor entry
      [0xbe5ff000..0xbe5ff5f4]
              at sun.awt.X11.XWindow.isParentOf(XWindow.java:241)
              - waiting to lock <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at
      sun.awt.X11.XModalStrategy$XApplicationModalityTreeUnsensetive.modalityStarts(XModalStrategy.java:86)
              at sun.awt.X11.XTransientForModality.setModal(XTransientForModality.java:35)
              at sun.awt.X11.XMWMModality.setModal(XMWMModality.java:72)
              at sun.awt.X11.XNETProtocol.setModal(XNETProtocol.java:207)
              at sun.awt.X11.XDialogPeer.handleMapNotifyEvent(XDialogPeer.java:87)
              at sun.awt.X11.XBaseWindow.dispatchEvent(XBaseWindow.java:813)
              at sun.awt.X11.XWindowPeer.dispatchEvent(XWindowPeer.java:437)
              at sun.awt.X11.XBaseWindow.dispatchToWindow(XBaseWindow.java:766)
              at sun.awt.X11.XToolkit.dispatchEvent(XToolkit.java:394)
              at sun.awt.X11.XToolkit.run(XToolkit.java:493)
              at sun.awt.X11.XToolkit.run(XToolkit.java:438)
              at java.lang.Thread.run(Thread.java:570)
       
      "Java2D Disposer" daemon prio=1 tid=0x08141338 nid=0x496 in Object.wait() [0xbe7ff000..0xbe7ff674]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x49c7e290> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
              - locked <0x49c7e290> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
              at sun.java2d.Disposer.run(Disposer.java:107)
              at java.lang.Thread.run(Thread.java:570)
       
      "CG Debugger Proxy" daemon prio=1 tid=0x0812ee10 nid=0x495 waiting on condition
      [0xbe9ff000..0xbe9ff6f4]
              at java.lang.Thread.sleep(Native Method)
              at DebuggerRT$ProxyThread.run(DebuggerRT.java:1435)
       
      "Low Memory Detector" daemon prio=1 tid=0x080a0e60 nid=0x493 runnable [0x00000000..0x00000000]
       
      "CompilerThread0" daemon prio=1 tid=0x0809f960 nid=0x492 waiting on condition
      [0x00000000..0xbefff25c]
       
      "Signal Dispatcher" daemon prio=1 tid=0x0809e958 nid=0x491 waiting on condition
      [0x00000000..0x00000000]
       
      "Finalizer" daemon prio=1 tid=0x0809a520 nid=0x490 in Object.wait() [0xbf3ff000..0xbf3ff574]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x49c7e498> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
              - locked <0x49c7e498> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
              at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
       
      "Reference Handler" daemon prio=1 tid=0x080997d8 nid=0x48f in Object.wait()
      [0xbf5ff000..0xbf5ff5f4]
              at java.lang.Object.wait(Native Method)
              - waiting on <0x49c7e518> (a java.lang.ref.Reference$Lock)
              at java.lang.Object.wait(Object.java:474)
              at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:117)
              - locked <0x49c7e518> (a java.lang.ref.Reference$Lock)
       
      "VM Thread" prio=1 tid=0x08095008 nid=0x48e runnable
       
      "VM Periodic Task Thread" prio=1 tid=0x080a22d0 nid=0x494 waiting on condition
       
       
      Found one Java-level deadlock:
      =============================
      "AWT-EventQueue-0":
        waiting to lock monitor 0x0809b424 (object 0x52031158, a java.lang.Class),
        which is held by "AWT-XAWT"
      "AWT-XAWT":
        waiting to lock monitor 0x0809b524 (object 0x49c7e590, a java.awt.Component$AWTTreeLock),
        which is held by "AWT-EventQueue-0"
       
      Java stack information for the threads listed above:
      ===================================================
      "AWT-EventQueue-0":
              at sun.awt.X11.XComponentPeer.restack(XComponentPeer.java:1364)
              - waiting to lock <0x52031158> (a java.lang.Class)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Component.addNotify(Component.java:5873)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Container.addNotify(Container.java:2486)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at javax.swing.JComponent.addNotify(JComponent.java:4407)
              at javax.swing.JRootPane.addNotify(JRootPane.java:676)
              at java.awt.Container.addNotify(Container.java:2493)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Window.addNotify(Window.java:458)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Dialog.addNotify(Dialog.java:376)
              - locked <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at java.awt.Window.pack(Window.java:476)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:37)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
              at java.awt.Dialog$1.run(Dialog.java:514)
              at java.awt.Dialog.show(Dialog.java:535)
              at DialogDeadlockTest$1.run(DialogDeadlockTest.java:40)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
              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-XAWT":
              at sun.awt.X11.XWindow.isParentOf(XWindow.java:241)
              - waiting to lock <0x49c7e590> (a java.awt.Component$AWTTreeLock)
              at
      sun.awt.X11.XModalStrategy$XApplicationModalityTreeUnsensetive.modalityStarts(XMo

            yan Yuri Nesterenko
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: