Hi Dmitry,

I was able to create a demo to reproduce it.
It seems that the issue is triggered by Windows#setEnabled(boolean).

Steps to reproduce it with attached WindowTest.java,
maybe you need 2-3 attempts:

(0. start the demo program)
1. click on the button in the first window ; a second window opens
2. click on the button in the second dialog ; a third windows open
3. move the third window via mouse and click on the label
4. wait 9 seconds ; a fourth windows is opened (the fourth windows should be 
opened behind the third)
5. try to close the fourth
-> EDT is blocked

Attached threads_report.txt is a full thread dump after step 5.

FYI:
I just re-checked the logs, the original integration test was never run on 
macOS with a older JDK 9.
The original integration passes with:
- JDK 8 u152 EA on Windows and macOS
- JDK 9 b157 EA on Windows ; macOS not tested
- JDK 9 b159 EA on Windows ; hangs on macOS as described

Thanks
Reto


> -----Ursprüngliche Nachricht-----
> Von: dmitry markov [mailto:dmitry.mar...@oracle.com]
> Gesendet: Donnerstag, 9. März 2017 08:52
> An: Reto Merz
> Cc: awt-dev@openjdk.java.net
> Betreff: Re: <AWT Dev> JDK 9 b159 -
> sun.lwawt.macosx.CWrapper$NSWindow.isZoomed never returns
> 
> Hi Reto,
> 
> I have no seen such hang before. Most likely this is a new issue.
> Could you provide us with a test case, (i.e. reproducer), please? Once
> we have a reproducer, I will open a bug for this.
> 
> Thanks,
> Dmitry
> On 07/03/2017 19:52, Reto Merz wrote:
> > Hi,
> >
> > We have a integration test which hangs with Java 9 b159 under macOS
> > 10.12.3.
> > It does not hang with b157 and also works with Windows OS & b159.
> > We can reproduce it always with our integration test.
> >
> > I want to ask if this is already a known regression?
> > Otherwise I can try to provide a simple test case to reproduce it but
> > this would take some time.
> >
> > The relevant thread stacks are:
> >
> > "AWT-EventQueue-0" #13 prio=6 os_prio=31 tid=0x00007fa86ea7e000
> > nid=0xd203 runnable [0x0000700010632000]
> >    java.lang.Thread.State: RUNNABLE
> >     at
> > sun.lwawt.macosx.CWrapper$NSWindow.isZoomed(java.desktop@9-
> ea/Native
> > Method)
> >     at
> > sun.lwawt.macosx.CPlatformWindow.isMaximized(java.desktop@9-
> ea/CPlatformWindow.java:509)
> >     at
> > sun.lwawt.macosx.CPlatformWindow.setVisible(java.desktop@9-
> ea/CPlatformWindow.java:558)
> >     at
> > sun.lwawt.LWWindowPeer.setVisibleImpl(java.desktop@9-
> ea/LWWindowPeer.java:253)
> >     at
> > sun.lwawt.LWComponentPeer.setVisible(java.desktop@9-
> ea/LWComponentPeer.java:763)
> >     at java.awt.Component.hide(java.desktop@9-ea/Component.java:1705)
> >     - locked <0x00000007a48a2c20> (a java.awt.Component$AWTTreeLock)
> >     at java.awt.Window.hide(java.desktop@9-ea/Window.java:1118)
> >     at java.awt.Dialog.hide(java.desktop@9-ea/Dialog.java:1152)
> >     at java.awt.Window.hide(java.desktop@9-ea/Window.java:1110)
> >     - locked <0x00000007a802e218> (a java.util.Vector)
> >     at java.awt.Dialog.hide(java.desktop@9-ea/Dialog.java:1152)
> >     at java.awt.Component.show(java.desktop@9-
> ea/Component.java:1670)
> >     at
> > java.awt.Component.setVisible(java.desktop@9-
> ea/Component.java:1615)
> >     at java.awt.Window.setVisible(java.desktop@9-ea/Window.java:1017)
> >     at java.awt.Dialog.setVisible(java.desktop@9-ea/Dialog.java:1005)
> >
> > "AppKit Thread" #11 daemon prio=5 os_prio=31 tid=0x00007fa87076b000
> > nid=0x307 waiting for monitor entry [0x00007fff5e87e000]
> >    java.lang.Thread.State: BLOCKED (on object monitor)
> >     at
> > java.awt.Window.getOwnedWindows_NoClientCode(java.desktop@9-
> ea/Window.java:1478)
> >     - waiting to lock <0x00000007a802e218> (a java.util.Vector)
> >     at
> > java.awt.Window$1.getOwnedWindows(java.desktop@9-
> ea/Window.java:4127)
> >     at
> >
> sun.lwawt.macosx.CPlatformWindow.orderAboveSiblingsImpl(java.desktop
> @9-ea/CPlatformWindow.java:1153)
> >     at
> >
> sun.lwawt.macosx.CPlatformWindow.orderAboveSiblings(java.desktop@9-
> ea/CPlatformWindow.java:1118)
> >     at
> >
> sun.lwawt.macosx.CPlatformWindow.windowDidBecomeMain(java.desktop
> @9-ea/CPlatformWindow.java:1182)
> >
> > Thanks
> > Reto
> >

"AWT-EventQueue-0@1030" prio=6 tid=0xf nid=NA runnable
  java.lang.Thread.State: RUNNABLE
         blocks AppKit Thread@973
          at sun.lwawt.macosx.CWrapper$NSWindow.isZoomed(CWrapper.java:-1)
          at 
sun.lwawt.macosx.CPlatformWindow.isMaximized(CPlatformWindow.java:509)
          at 
sun.lwawt.macosx.CPlatformWindow.setVisible(CPlatformWindow.java:558)
          at sun.lwawt.LWWindowPeer.setVisibleImpl(LWWindowPeer.java:253)
          at sun.lwawt.LWComponentPeer.setVisible(LWComponentPeer.java:763)
          at java.awt.Component.hide(Component.java:1705)
          - locked <0x848> (a java.awt.Component$AWTTreeLock)
          at java.awt.Window.hide(Window.java:1118)
          at java.awt.Dialog.hide(Dialog.java:1152)
          at java.awt.Window.hide(Window.java:1110)
          - locked <0x849> (a java.util.Vector)
          at java.awt.Dialog.hide(Dialog.java:1152)
          at java.awt.Component.show(Component.java:1670)
          at java.awt.Component.setVisible(Component.java:1615)
          at java.awt.Window.setVisible(Window.java:1017)
          at java.awt.Dialog.setVisible(Dialog.java:1005)
          at WindowTest$MyDialog.setVisible(WindowTest.java:109)
          at WindowTest$1$1$1$1.actionPerformed(WindowTest.java:41)
          at javax.swing.Timer.fireActionPerformed(Timer.java:317)
          at javax.swing.Timer$DoPostEvent.run(Timer.java:249)
          at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
          at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:759)
          at java.awt.EventQueue.access$500(EventQueue.java:97)
          at java.awt.EventQueue$3.run(EventQueue.java:712)
          at java.awt.EventQueue$3.run(EventQueue.java:706)
          at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
          at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:88)
          at java.awt.EventQueue.dispatchEvent(EventQueue.java:729)
          at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199)
          at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
          at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
          at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
          at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
          at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
          at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
          at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
          at java.awt.Dialog.show(Dialog.java:1070)
          at java.awt.Component.show(Component.java:1668)
          at java.awt.Component.setVisible(Component.java:1615)
          at java.awt.Window.setVisible(Window.java:1017)
          at java.awt.Dialog.setVisible(Dialog.java:1005)
          at WindowTest$MyDialog.setVisible(WindowTest.java:109)
          at WindowTest$1$1$1.actionPerformed(WindowTest.java:61)
          at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
          at 
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
          at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
          at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
          at 
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:269)
          at java.awt.Component.processMouseEvent(Component.java:6577)
          at javax.swing.JComponent.processMouseEvent(JComponent.java:3343)
          at java.awt.Component.processEvent(Component.java:6342)
          at java.awt.Container.processEvent(Container.java:2259)
          at java.awt.Component.dispatchEventImpl(Component.java:4960)
          at java.awt.Container.dispatchEventImpl(Container.java:2317)
          at java.awt.Component.dispatchEvent(Component.java:4792)
          at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
          at 
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
          at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4474)
          at java.awt.Container.dispatchEventImpl(Container.java:2303)
          at java.awt.Window.dispatchEventImpl(Window.java:2758)
          at java.awt.Component.dispatchEvent(Component.java:4792)
          at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761)
          at java.awt.EventQueue.access$500(EventQueue.java:97)
          at java.awt.EventQueue$3.run(EventQueue.java:712)
          at java.awt.EventQueue$3.run(EventQueue.java:706)
          at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
          at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:88)
          at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98)
          at java.awt.EventQueue$4.run(EventQueue.java:734)
          at java.awt.EventQueue$4.run(EventQueue.java:732)
          at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
          at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:88)
          at java.awt.EventQueue.dispatchEvent(EventQueue.java:731)
          at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199)
          at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
          at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
          at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
          at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
          at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
          at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
          at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
          at java.awt.Dialog.show(Dialog.java:1070)
          at java.awt.Component.show(Component.java:1668)
          at java.awt.Component.setVisible(Component.java:1615)
          at java.awt.Window.setVisible(Window.java:1017)
          at java.awt.Dialog.setVisible(Dialog.java:1005)
          at WindowTest$MyDialog.setVisible(WindowTest.java:109)
          at WindowTest$1$1.actionPerformed(WindowTest.java:70)
          at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
          at 
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
          at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
          at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
          at 
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:269)
          at java.awt.Component.processMouseEvent(Component.java:6577)
          at javax.swing.JComponent.processMouseEvent(JComponent.java:3343)
          at java.awt.Component.processEvent(Component.java:6342)
          at java.awt.Container.processEvent(Container.java:2259)
          at java.awt.Component.dispatchEventImpl(Component.java:4960)
          at java.awt.Container.dispatchEventImpl(Container.java:2317)
          at java.awt.Component.dispatchEvent(Component.java:4792)
          at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
          at 
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
          at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4474)
          at java.awt.Container.dispatchEventImpl(Container.java:2303)
          at java.awt.Window.dispatchEventImpl(Window.java:2758)
          at java.awt.Component.dispatchEvent(Component.java:4792)
          at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761)
          at java.awt.EventQueue.access$500(EventQueue.java:97)
          at java.awt.EventQueue$3.run(EventQueue.java:712)
          at java.awt.EventQueue$3.run(EventQueue.java:706)
          at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
          at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:88)
          at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98)
          at java.awt.EventQueue$4.run(EventQueue.java:734)
          at java.awt.EventQueue$4.run(EventQueue.java:732)
          at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
          at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:88)
          at java.awt.EventQueue.dispatchEvent(EventQueue.java:731)
          at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199)
          at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
          at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
          at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
          at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
          at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

"TimerQueue@2103" daemon prio=5 tid=0x13 nid=NA waiting
  java.lang.Thread.State: WAITING
          at jdk.internal.misc.Unsafe.park(Unsafe.java:-1)
          at java.util.concurrent.locks.LockSupport.park(LockSupport.java:192)
          at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2062)
          at java.util.concurrent.DelayQueue.take(DelayQueue.java:217)
          at javax.swing.TimerQueue.run(TimerQueue.java:171)
          at java.lang.Thread.run(Thread.java:844)

"AppKit Thread@973" daemon prio=5 tid=0xd nid=NA waiting for monitor entry
  java.lang.Thread.State: BLOCKED
         waiting for AWT-EventQueue-0@1030 to release lock on <0x849> (a 
java.util.Vector)
          at java.awt.Window.getOwnedWindows_NoClientCode(Window.java:1484)
          at java.awt.Window$1.getOwnedWindows(Window.java:4127)
          at 
sun.lwawt.macosx.CPlatformWindow.orderAboveSiblingsImpl(CPlatformWindow.java:1153)
          at 
sun.lwawt.macosx.CPlatformWindow.orderAboveSiblings(CPlatformWindow.java:1118)
          at 
sun.lwawt.macosx.CPlatformWindow.windowDidBecomeMain(CPlatformWindow.java:1182)

"Common-Cleaner@2114" daemon prio=8 tid=0x8 nid=NA waiting
  java.lang.Thread.State: WAITING
          at java.lang.Object.wait(Object.java:-1)
          at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
          at jdk.internal.ref.CleanerImpl.run(CleanerImpl.java:148)
          at java.lang.Thread.run(Thread.java:844)
          at jdk.internal.misc.InnocuousThread.run(InnocuousThread.java:122)

"Java2D Queue Flusher@1110" daemon prio=10 tid=0x10 nid=NA waiting
  java.lang.Thread.State: WAITING
          at java.lang.Object.wait(Object.java:-1)
          at 
sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:205)
          at java.lang.Thread.run(Thread.java:844)

"Java2D Disposer@1318" daemon prio=10 tid=0x12 nid=NA waiting
  java.lang.Thread.State: WAITING
          at java.lang.Object.wait(Object.java:-1)
          at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
          at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:172)
          at sun.java2d.Disposer.run(Disposer.java:144)
          at java.lang.Thread.run(Thread.java:844)

"AWT-Shutdown@977" prio=5 tid=0xe nid=NA waiting
  java.lang.Thread.State: WAITING
          at java.lang.Object.wait(Object.java:-1)
          at java.lang.Object.wait(Object.java:516)
          at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:291)
          at java.lang.Thread.run(Thread.java:844)

"Finalizer@2116" daemon prio=8 tid=0x3 nid=NA waiting
  java.lang.Thread.State: WAITING
          at java.lang.Object.wait(Object.java:-1)
          at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
          at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:172)
          at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:216)

"Reference Handler@2117" daemon prio=10 tid=0x2 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
          at 
java.lang.ref.Reference.waitForReferencePendingList(Reference.java:-1)
          at 
java.lang.ref.Reference.processPendingReferences(Reference.java:163)
          at java.lang.ref.Reference.access$000(Reference.java:44)
          at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:138)

"DestroyJavaVM@1113" prio=5 tid=0x11 nid=NA runnable
  java.lang.Thread.State: RUNNABLE

"Signal Dispatcher@2115" daemon prio=9 tid=0x4 nid=NA runnable
  java.lang.Thread.State: RUNNABLE

Attachment: WindowTest.java
Description: Binary data

Reply via email to