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

Application does not terminate after calling JOptionPane.createDialog

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b70
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      I am creating a JEditorPane and passing a text file to it. I am calling JEditorPane.print() and a PrintDialog pops up. I am cancelling the dialog. After this, the application just waits there and not terminating properly. This is incorrect. There is no code in the application after the print() call and the application is not creating any UI of it's own.

      This is reproducible on all Mustang builds which has this feature, with WinXP as well as SolSparc10. I reproduced it with Mustang-b62.

      I have attached a sample test. Execute the sample test. You would see a cross-platform print dialog. Cancel the print dialog. If the application does not exit, the bug is reproduced.

      Here is the thread dump when the app waits indefinitely:

      Full thread dump Java HotSpot(TM) Client VM (1.6.0-rc-b62 mixed mode):

      "DestroyJavaVM" prio=6 tid=0x00036d00 nid=0xf730 waiting on condition [0x0000000
      0..0x008ffd4c]
         java.lang.Thread.State: RUNNABLE

      "Thread-2" daemon prio=6 tid=0x0ae8cc00 nid=0x124a8 runnable [0x0c45f000..0x0c45
      fa94]
         java.lang.Thread.State: RUNNABLE
              at sun.print.Win32PrintServiceLookup.notifyPrinterChange(Native Method)
              at sun.print.Win32PrintServiceLookup.access$100(Win32PrintServiceLookup.
      java:32)
              at sun.print.Win32PrintServiceLookup$PrinterChangeListener.run(Win32Prin
      tServiceLookup.java:302)

      "AWT-EventQueue-0" prio=6 tid=0x0ae59f00 nid=0x11268 in Object.wait() [0x0b1ff00
      0..0x0b1ffb14]
         java.lang.Thread.State: WAITING (on object monitor)
              at java.lang.Object.wait(Native Method)
              - waiting on <0x02e6d768> (a java.awt.EventQueue)
              at java.lang.Object.wait(Object.java:484)
              at java.awt.EventQueue.getNextEvent(EventQueue.java:480)
              - locked <0x02e6d768> (a java.awt.EventQueue)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
      ad.java:245)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:183)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:173)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

      "AWT-Shutdown" prio=6 tid=0x0aaea100 nid=0x127b4 in Object.wait() [0x0b1af000..0
      x0b1afb94]
         java.lang.Thread.State: WAITING (on object monitor)
              at java.lang.Object.wait(Native Method)
              - waiting on <0x02e65c30> (a java.lang.Object)
              at java.lang.Object.wait(Object.java:484)
              at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
              - locked <0x02e65c30> (a java.lang.Object)
              at java.lang.Thread.run(Thread.java:626)

      "AWT-Windows" daemon prio=6 tid=0x0ae14200 nid=0x12268 runnable [0x0b07f000..0x0
      b07fc94]
         java.lang.Thread.State: RUNNABLE
              at sun.awt.windows.WToolkit.eventLoop(Native Method)
              at sun.awt.windows.WToolkit.run(WToolkit.java:290)
              at java.lang.Thread.run(Thread.java:626)

      "Java2D Disposer" daemon prio=10 tid=0x0ae12f00 nid=0x12760 in Object.wait() [0x
      0afdf000..0x0afdfd94]
         java.lang.Thread.State: WAITING (on object monitor)
              at java.lang.Object.wait(Native Method)
              - waiting on <0x02eadfd0> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
              - locked <0x02eadfd0> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
              at sun.java2d.Disposer.run(Disposer.java:123)
              at java.lang.Thread.run(Thread.java:626)

      "Low Memory Detector" daemon prio=6 tid=0x0aaf5400 nid=0x1fc4 runnable [0x000000
      00..0x00000000]
         java.lang.Thread.State: RUNNABLE

      "CompilerThread0" daemon prio=10 tid=0x0aaf2f00 nid=0x127d4 waiting on condition
       [0x00000000..0x0acdf964]
         java.lang.Thread.State: RUNNABLE

      "Attach Listener" daemon prio=10 tid=0x0aaf2000 nid=0x1f88 runnable [0x00000000.
      .0x00000000]
         java.lang.Thread.State: RUNNABLE

      "Signal Dispatcher" daemon prio=10 tid=0x0aaf1500 nid=0x48cc waiting on conditio
      n [0x00000000..0x00000000]
         java.lang.Thread.State: RUNNABLE

      "Finalizer" daemon prio=8 tid=0x0aae5300 nid=0x31cc in Object.wait() [0x0abef000
      ..0x0abefc94]
         java.lang.Thread.State: WAITING (on object monitor)
              at java.lang.Object.wait(Native Method)
              - waiting on <0x02eae228> (a java.lang.ref.ReferenceQueue$Lock)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
              - locked <0x02eae228> (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=10 tid=0x0aae1100 nid=0x11bc4 in Object.wait() [
      0x0ab9f000..0x0ab9fd14]
         java.lang.Thread.State: WAITING (on object monitor)
              at java.lang.Object.wait(Native Method)
              - waiting on <0x02eadee8> (a java.lang.ref.Reference$Lock)
              at java.lang.Object.wait(Object.java:484)
              at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
              - locked <0x02eadee8> (a java.lang.ref.Reference$Lock)

      "VM Thread" prio=10 tid=0x0aade200 nid=0x35d8 runnable

      "VM Periodic Task Thread" prio=10 tid=0x0aaf6800 nid=0x12654 waiting on conditio
      n

      JNI global references: 883

        Attachments

          Activity

            People

            Assignee:
            alexp Alexander Potochkin (Inactive)
            Reporter:
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: