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

Deadlock occuring with Component$AWTTreeLock

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      A deadlock can be seen using 1.4.1_02 and Mantis-beta Java Plugin.
      The testcase, source code and full threaddumps are located in the attachments.

      The thread dump shows a classic deadlock with the
      "applet-ScrollableTableApplet" thread making a call into
      GridPanel.setBounds locking ScrollableTable but is stuck in a wait-on-monitor
      state for the java.awt.Component$AWTTreeLock monitor held by the
      "AWT-EventQueue-14" thread.

      The "AWT-EventQueue-14" thread holds the java.awt.Component$AWTTreeLock monitor
      while waiting for its turn to run the GridPanel.setBounds method.

      I attached part of the thread dump below showns the threads and locks
      involved:

      Full thread dump Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode):
      Found one Java-level deadlock:
      =============================
      "AWT-EventQueue-14":
        waiting to lock monitor 0x27c6774 (object 0x543d020, a ScrollableTable),
        which is held by "thread applet-ScrollableTableApplet"
      "thread applet-ScrollableTableApplet":
        waiting to lock monitor 0x27c6734 (object 0x5bb2450, a java.awt.Component$AWTT
      reeLock),
        which is held by "AWT-EventQueue-14"

      "AWT-EventQueue-14" prio=4 tid=0x027A9028 nid=0x110 waiting for monitor entry [2
      0d9f000..20d9fd8c]
              at CoffeeTable.Grid.GridPanel.setBounds(GridPanel.java:1988)
              - waiting to lock <0543D020> (a ScrollableTable)
              at java.awt.GridBagLayout.ArrangeGrid(GridBagLayout.java:1523)
              at java.awt.GridBagLayout.arrangeGrid(GridBagLayout.java:1336)
              at java.awt.GridBagLayout.layoutContainer(GridBagLayout.java:706)
              at java.awt.Container.layout(Container.java:1017)
              at java.awt.Container.doLayout(Container.java:1007)
              at java.awt.Container.validateTree(Container.java:1089)
              at java.awt.Container.validateTree(Container.java:1096)
              at java.awt.Container.validateTree(Container.java:1096)
              at java.awt.Container.validate(Container.java:1064)
              - locked <05BB2450> (a java.awt.Component$AWTTreeLock)
              at sun.plugin.AppletViewer$AppletEventListener.appletStateChanged(Applet
      Viewer.java:503)

      "thread applet-ScrollableTableApplet" prio=4 tid=0x026A6DF8 nid=0x2ec waiting fo
      r monitor entry [1fb9f000..1fb9fd8c]
              at java.awt.Component.reshape(Component.java:1674)
              - waiting to lock <05BB2450> (a java.awt.Component$AWTTreeLock)
              at java.awt.Component.setBounds(Component.java:1665)
              at CoffeeTable.Grid.GridPanel.redoScrollbars(GridPanel.java:6743)
              at CoffeeTable.Grid.GridPanel.setBounds(GridPanel.java:1997)
              - locked <0543D020> (a ScrollableTable)
              at java.awt.Component.resize(Component.java:1602)
              at java.awt.Component.setSize(Component.java:1594)
              at ScrollableTableApplet.setGridSize(ScrollableTableApplet.java:1376)
              at ScrollableTableApplet.init(ScrollableTableApplet.java:285)
              at sun.applet.AppletPanel.run(AppletPanel.java:348)
              at java.lang.Thread.run(Thread.java:536)

        Attachments

          Activity

            People

            Assignee:
            zgu Zhengyu Gu
            Reporter:
            atongschsunw Albert Tong-schmidt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: