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

Modal dialogs can't be used in contexts where Component.LOCK has been acquired

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 1.0.2, 1.1.4
    • client-libs
    • generic, sparc
    • generic, solaris_2.4

    Description

      See, for example, the attached stack trace. The relevant part is here:

          "Screen Updater" (TID:0xed9d84a0, sys_thread_t:0xecd71de0, state:CW) prio=6
              java.lang.Object.wait(Object.java)
              sun.awt.motif.MDialogPeer.show(MDialogPeer.java:104)
              java.awt.Dialog.show(Dialog.java:220)
              java.awt.Component.show(Component.java:498)
              java.awt.Component.setVisible(Component.java:460)
              sunw.hotjava.security.BagDialog.handleDialog(BagDialog.java:143)
              sunw.hotjava.security.SecurityDialog.askAuthorization(SecurityDialog.java:155)
              sunw.hotjava.security.SecurityDialog.getAuthorization(SecurityDialog.java:113)
              sunw.hotjava.security.SecurityDialog.getPropAuthorization(SecurityDialog.java:210)
              sunw.hotjava.security.PolicyMedium.checkPropertyAccess(PolicyMedium.java:127)
              sunw.hotjava.security.SecurityPolicy.checkPropertyAccess(SecurityPolicy.java:284)
              java.lang.System.getProperty(System.java)
              jclass.util.JCEnvironment.getJavaVersion(JCEnvironment.java:167)
              jclass.table.Draw.<clinit>(Draw.java:272)
              java.lang.ClassLoader.loadClassInternal(ClassLoader.java)
              jclass.table.TraverseInitial.traverse(TraverseInitial.java:183)
              jclass.table.TraverseInitial.traverse(TraverseInitial.java:118)
              jclass.table.JCTableLite.reshape(JCTableLite.java:1521)
              java.awt.Component.setBounds(Component.java:889)
              java.awt.GridBagLayout.ArrangeGrid(GridBagLayout.java:1256)

      Screen Updater has Component.LOCK, and it's trying to post a modal dialog.
      The code in MDialogPeer creates a thread and blocks on it, and that
      thread waits for Component.LOCK.

      The problem (at least for Solaris) is the code in MDialogPeer:

              if (((Dialog)target).isModal()) {
                  ModalThread mt = new ModalThread(this);
                  synchronized(mt) {
                      try {
                          mt.start();
                          mt.wait();
                      } catch (InterruptedException e) {
                      }
                  }

      The current thread (which holds Component.LOCK) is waiting on the
      ModalThread, but ModalThread immediately requests Component.LOCK.

      See suggested fix

      Attachments

        Issue Links

          Activity

            People

              duke J. Duke
              bfootesunw Bill Foote (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: