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

[JFXPanel, Mac] popups + -Djavafx.embed.singleThread=true causes deadlock

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u20
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Labels:
      None

      Description

      Run the attached program with -Djavafx.embed.singleThread=true to reproduce deadlock on Mac. Here is the full thread dump when the program is in deadlock:

      java -Djavafx.embed.singleThread=true hello.JavaFXSwingApplication2
      2014-10-07 13:39:23
      Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):

      "Prism Font Disposer" #21 daemon prio=10 os_prio=31 tid=0x00007f9934214000 nid=0xc007 in Object.wait() [0x0000000124187000]
         java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on <0x0000000795a20db8> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
      - locked <0x0000000795a20db8> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
      at com.sun.javafx.font.Disposer.run(Disposer.java:93)
      at java.lang.Thread.run(Thread.java:745)

      "Thread-2" #20 daemon prio=5 os_prio=31 tid=0x00007f9939800000 nid=0xbe03 runnable [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE

      "Thread-1" #19 daemon prio=6 os_prio=31 tid=0x00007f99358db000 nid=0xb20b in Object.wait() [0x0000000123568000]
         java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on <0x0000000797600840> (a java.lang.StringBuilder)
      at java.lang.Object.wait(Object.java:502)
      at com.sun.glass.ui.InvokeLaterDispatcher.run(InvokeLaterDispatcher.java:126)
      - locked <0x0000000797600840> (a java.lang.StringBuilder)

      "QuantumRenderer-0" #17 daemon prio=6 os_prio=31 tid=0x00007f993584b800 nid=0xab03 waiting on condition [0x00000001231cc000]
         java.lang.Thread.State: WAITING (parking)
      at sun.misc.Unsafe.park(Native Method)
      - parking to wait for <0x0000000797610178> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
      at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
      at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:126)
      at java.lang.Thread.run(Thread.java:745)

      "TimerQueue" #16 daemon prio=5 os_prio=31 tid=0x00007f9933986800 nid=0xa903 waiting on condition [0x00000001230c9000]
         java.lang.Thread.State: WAITING (parking)
      at sun.misc.Unsafe.park(Native Method)
      - parking to wait for <0x00000007976009e0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
      at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
      at java.util.concurrent.DelayQueue.take(DelayQueue.java:211)
      at javax.swing.TimerQueue.run(TimerQueue.java:171)
      at java.lang.Thread.run(Thread.java:745)

      "Java2D Disposer" #15 daemon prio=10 os_prio=31 tid=0x00007f993493b800 nid=0xa703 in Object.wait() [0x0000000122fbd000]
         java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on <0x0000000797618178> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
      - locked <0x0000000797618178> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
      at sun.java2d.Disposer.run(Disposer.java:148)
      at java.lang.Thread.run(Thread.java:745)

      "Java2D Queue Flusher" #14 daemon prio=10 os_prio=31 tid=0x00007f9935845000 nid=0x9d0b in Object.wait() [0x00000001222a6000]
         java.lang.Thread.State: TIMED_WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
      - locked <0x0000000797620000> (a sun.java2d.opengl.OGLRenderQueue$QueueFlusher)

      "DestroyJavaVM" #13 prio=5 os_prio=31 tid=0x00007f993584a000 nid=0x1d03 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE

      "AWT-EventQueue-0" #12 prio=6 os_prio=31 tid=0x00007f9935836800 nid=0x9a0b runnable [0x00000001221a2000]
         java.lang.Thread.State: RUNNABLE
      at sun.java2d.opengl.CGLLayer.nativeCreateLayer(Native Method)
      at sun.java2d.opengl.CGLLayer.<init>(CGLLayer.java:55)
      at sun.lwawt.macosx.CPlatformView.createCGLayer(CPlatformView.java:65)
      at sun.lwawt.macosx.CPlatformView.initialize(CPlatformView.java:59)
      at sun.lwawt.macosx.CPlatformWindow.initialize(CPlatformWindow.java:233)
      at sun.lwawt.LWWindowPeer.<init>(LWWindowPeer.java:154)
      at sun.lwawt.LWToolkit.createDelegatedPeer(LWToolkit.java:210)
      at sun.lwawt.LWToolkit.createFrame(LWToolkit.java:239)
      at java.awt.Frame.addNotify(Frame.java:477)
      - locked <0x00000007976302f0> (a java.awt.Component$AWTTreeLock)
      at java.awt.Window.pack(Window.java:807)
      at hello.JavaFXSwingApplication2$1.run(JavaFXSwingApplication2.java:46)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
      at java.awt.EventQueue.access$400(EventQueue.java:97)
      at java.awt.EventQueue$3.run(EventQueue.java:697)
      at java.awt.EventQueue$3.run(EventQueue.java:691)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

      "AWT-Shutdown" #11 prio=5 os_prio=31 tid=0x00007f99348ec000 nid=0x7803 in Object.wait() [0x000000011f83b000]
         java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on <0x00000007976282f0> (a java.lang.Object)
      at java.lang.Object.wait(Object.java:502)
      at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:295)
      - locked <0x00000007976282f0> (a java.lang.Object)
      at java.lang.Thread.run(Thread.java:745)

      "JavaFX Application Thread" #10 daemon prio=5 os_prio=31 tid=0x00007f99340b6800 nid=0x707 waiting for monitor entry [0x00007fff65352000]
         java.lang.Thread.State: BLOCKED (on object monitor)
      at java.awt.Component.invalidate(Component.java:2926)
      - waiting to lock <0x00000007976302f0> (a java.awt.Component$AWTTreeLock)
      at java.awt.Container.invalidate(Container.java:1585)
      at javax.swing.JComponent.revalidate(JComponent.java:4853)
      at javafx.embed.swing.JFXPanel$HostContainer.setPreferredSize(JFXPanel.java:883)
      at com.sun.javafx.tk.quantum.EmbeddedStage.setBounds(EmbeddedStage.java:77)
      at javafx.stage.Window$TKBoundsConfigurator.apply(Window.java:1254)
      at javafx.stage.Window.applyBounds(Window.java:1144)
      at javafx.stage.Window.adjustSize(Window.java:241)
      at javafx.stage.Window.access$600(Window.java:77)
      at javafx.stage.Window$9.invalidated(Window.java:831)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
      at javafx.stage.Window.setShowing(Window.java:902)
      at javafx.stage.Window.show(Window.java:917)
      at com.sun.javafx.stage.EmbeddedWindow.show(EmbeddedWindow.java:58)
      at javafx.embed.swing.JFXPanel.setSceneImpl(JFXPanel.java:284)
      at javafx.embed.swing.JFXPanel.setScene(JFXPanel.java:254)
      at hello.JavaFXSwingApplication2.createScene(JavaFXSwingApplication2.java:80)
      at hello.JavaFXSwingApplication2.lambda$init$260(JavaFXSwingApplication2.java:61)
      at hello.JavaFXSwingApplication2$$Lambda$54/509487986.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$null$166(PlatformImpl.java:295)
      at com.sun.javafx.application.PlatformImpl$$Lambda$57/1015520129.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.lambda$runLater$167(PlatformImpl.java:294)
      at com.sun.javafx.application.PlatformImpl$$Lambda$56/833481085.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

      "Service Thread" #9 daemon prio=9 os_prio=31 tid=0x00007f9934850800 nid=0x6003 runnable [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE

      "C1 CompilerThread3" #8 daemon prio=9 os_prio=31 tid=0x00007f9934835800 nid=0x5e03 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE

      "C2 CompilerThread2" #7 daemon prio=9 os_prio=31 tid=0x00007f9934834800 nid=0x5c03 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE

      "C2 CompilerThread1" #6 daemon prio=9 os_prio=31 tid=0x00007f9934828800 nid=0x5a03 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE

      "C2 CompilerThread0" #5 daemon prio=9 os_prio=31 tid=0x00007f9934827000 nid=0x5803 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE

      "Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007f9934808000 nid=0x5603 waiting on condition [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE

      "Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007f99338a6000 nid=0x4603 in Object.wait() [0x000000011dad2000]
         java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on <0x0000000797620480> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
      - locked <0x0000000797620480> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
      at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

      "Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007f99338a5000 nid=0x4403 in Object.wait() [0x000000011d9cf000]
         java.lang.Thread.State: WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on <0x0000000797628bf8> (a java.lang.ref.Reference$Lock)
      at java.lang.Object.wait(Object.java:502)
      at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
      - locked <0x0000000797628bf8> (a java.lang.ref.Reference$Lock)

      "VM Thread" os_prio=31 tid=0x00007f99338a0800 nid=0x4203 runnable

      "GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007f9933850000 nid=0x3203 runnable

      "GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007f9933850800 nid=0x3403 runnable

      "GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007f9933851800 nid=0x3603 runnable

      "GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007f9933852000 nid=0x3803 runnable

      "GC task thread#4 (ParallelGC)" os_prio=31 tid=0x00007f9933852800 nid=0x3a03 runnable

      "GC task thread#5 (ParallelGC)" os_prio=31 tid=0x00007f9933853000 nid=0x3c03 runnable

      "GC task thread#6 (ParallelGC)" os_prio=31 tid=0x00007f9933854000 nid=0x3e03 runnable

      "GC task thread#7 (ParallelGC)" os_prio=31 tid=0x00007f9933854800 nid=0x4003 runnable

      "VM Periodic Task Thread" os_prio=31 tid=0x00007f9934834000 nid=0x6203 waiting on condition

      JNI global references: 464

      Heap
       PSYoungGen total 38400K, used 11102K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
        eden space 33280K, 17% used [0x0000000795580000,0x0000000795b581f8,0x0000000797600000)
        from space 5120K, 99% used [0x0000000797600000,0x0000000797aff6d8,0x0000000797b00000)
        to space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
       ParOldGen total 87552K, used 2518K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
        object space 87552K, 2% used [0x0000000740000000,0x0000000740275980,0x0000000745580000)
       Metaspace used 14935K, capacity 15252K, committed 15360K, reserved 1062912K
        class space used 1949K, capacity 2026K, committed 2048K, reserved 1048576K


        Attachments

          Activity

            People

            Assignee:
            ant Anton Tarasov
            Reporter:
            ckyang Chien Yang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: