Bug 1247

Summary: TestGearsNewtAWTWrapper fail to acquire surface lock on secondary monitor
Product: [JogAmp] Newt Reporter: Xerxes Rånby <xerxes>
Component: awtAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 2.3.2   
Hardware: pc_x86_64   
OS: linux   
Type: DEFECT SCM Refs:
108ff459c21ef04e541c714658b6b18f28e3c748 0abf3c058b1ad7f43328a79098890149e6fa8a14 78bb597a06180c968ff5a10a7e3f44bd058965d6 c1594efa78951f187a75ec0b9a85cf64fba418d4
Workaround: ---
Attachments: TEST-com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper.xml

Description Xerxes Rånby 2015-10-06 08:49:57 CEST
Created attachment 753 [details]
TEST-com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper.xml

Steps to reproduce:
configure desktop to use a secondary monitor to the left of the primary monitor
open eclipse
click on com.jogamp.opengl.test.junit.jogl.demos.gl2.newt
select TestGearsNewtAWTWrapper
select junit run

Test can also be reproduced using the command line
cd jogl/make
ant junit.run
see attached TEST-com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper.xml

+++ test output
junit test test01

java.lang.RuntimeException: Waited 5000ms for: <2401f4c3, 7637f22>[count 1, qsz 0, owner <main-AWTAnimator#00>] - <main>
	at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
	at com.jogamp.nativewindow.awt.JAWTWindow.lockSurface(JAWTWindow.java:655)
	at jogamp.opengl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:307)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:602)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:586)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1279)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
	at com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper.runTestGL(TestGearsNewtAWTWrapper.java:105)
	at com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper.test01(TestGearsNewtAWTWrapper.java:140)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

+++ delta
(01:38:32) xranby_f22:  eclipse mars 4.5.0.v20150826-1000
(01:38:42) xranby_f22: Fedora 22 / Gnome
(01:39:59) xranby_f22: test passes with only one monitor
(01:40:05) xranby_f22: test fails with two monitors
(01:46:53) xranby_f22: primary monitor 1920x1080     secondary monitor 1280x1024
(01:46:58) xranby_f22: test passes with two monitors if the test window opens on the primary monitor
(01:47:01) xranby_f22: test fails with two monitors if the test window opens on the secondary monitor
(01:47:05) xranby_f22: the secondary monitor is numbered monitor 1    the primary monitor is numbered monitor 2
(01:47:09) xranby_f22: the secondary monitor is positioned to the left of the primary monitor
(01:47:13) xranby_f22: the test fails when the secondary monitor is positioned to the left of the primary monitor, then the test window opens on the secondary monitor
(01:47:17) xranby_f22: the test pass when the secondary monitor is positioned to the right of the primary monitor, then the test window opens on the primary monitor
(01:47:30) xranby_f22: sgothel: there is the delta, as narrowed down as i can find
(01:47:55) xranby_f22: hence the test TestGearsNewtAWTWrapper fails if the test window is opened on the secondary monitor
Comment 1 Xerxes Rånby 2015-10-06 08:52:44 CEST
The test configuration is quite similar to Bug 1198
Since this bug is easy to reproducible I am adding it as a blocker for 1198
Comment 2 Xerxes Rånby 2015-10-06 08:58:50 CEST
system-err of the automated junit test reveal:

AWTRobotUtil: UncaughtException (this Thread main-AWTAnimator#00) : Thread <main-AWTAnimator#00>, com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: java.lang.NullPointerException
com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: java.lang.NullPointerException
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:92)
	at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
	at com.jogamp.opengl.util.Animator$MainLoop.run(Animator.java:204)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at com.jogamp.nativewindow.awt.JAWTWindow.lockSurface(JAWTWindow.java:677)
	at jogamp.opengl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:307)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:602)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:586)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1279)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
	...
Comment 3 Xerxes Rånby 2015-10-06 09:07:45 CEST
system-err of the automated junit test attachment 753 [details] also reveal:
 AWTRobotUtil: UncaughtException (this Thread AWT-EventQueue-0) : Thread <AWT-EventQueue-0>, java.lang.NullPointerException: null
java.lang.NullPointerException
	at com.jogamp.nativewindow.awt.JAWTWindow.getGraphicsConfiguration(JAWTWindow.java:774)
	at jogamp.opengl.GLDrawableImpl.getChosenGLCapabilities(GLDrawableImpl.java:131)
	at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:243)
	at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119)
	at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141)
	at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4347)
	at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4281)
	at jogamp.newt.WindowImpl.sizeChanged(WindowImpl.java:4467)
	at jogamp.newt.driver.awt.WindowDriver.access$500(WindowDriver.java:65)
	at jogamp.newt.driver.awt.WindowDriver$LocalWindowListener.windowResized(WindowDriver.java:312)
	at com.jogamp.newt.event.awt.AWTWindowAdapter.componentResized(AWTWindowAdapter.java:144)
	at java.awt.AWTEventMulticaster.componentResized(AWTEventMulticaster.java:159)
	at java.awt.Component.processComponentEvent(Component.java:6351)
	at java.awt.Component.processEvent(Component.java:6305)
	at java.awt.Component.dispatchEventImpl(Component.java:4881)
	at java.awt.Component.dispatchEvent(Component.java:4703)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	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)
Comment 4 Xerxes Rånby 2015-10-06 09:48:14 CEST
http://jogamp.org/log/irc/jogamp_20151005050515.html#l282

20151005 22:58:48 <sgothel> TestGearsNewtAWTWrapper .. ah that one :)
20151005 22:59:05 <sgothel> not using NewtCanvasAWT .. but the 'odd backend AWT' for NEWT
20151005 22:59:36 <xranby_f22> is that a good thing?
20151005 23:00:08 <sgothel> yes .. i.e. not a test case really important
20151005 23:00:14 <sgothel> i.e. nobody uses the AWT backend
20151005 23:00:18 <xranby_f22> NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT
20151005 23:00:24 <sgothel> it is more .. esotheric ..still
Comment 5 Xerxes Rånby 2015-10-06 11:57:55 CEST
The NPE seen in Comment 2 and Comment 3 indicate that awtConfig is null in JAWTWindow

likely caused by AWT has sent an dispose before we (jogl) gets to dispose

adding null pointer checks in the two methods is trivial, however i dont think that is the right solution because the window should not have been disposed while it is still active and visible!

+++ example trivial patch, note that it puts a demand of all users of getGraphicsConfiguration to handle returned null.

diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
index 5d84325..5764296 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
@@ -665,7 +665,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
             }
         } else {
             final GraphicsConfiguration gc;
-            if( EventQueue.isDispatchThread() || Thread.holdsLock(component.getTreeLock()) ) {
+            if( EventQueue.isDispatchThread() || Thread.holdsLock(component.getTreeLock()) || null == awtConfig ) {
                 /**
                  * Trigger detection of possible reconfiguration before 'sun.awt.SunToolkit.awtLock()',
                  * which maybe triggered via adevice.lock() below (X11).
@@ -771,6 +771,9 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
 
   @Override
   public final AbstractGraphicsConfiguration getGraphicsConfiguration() {
+    if(null == awtConfig) {
+        return null;
+    }
     return awtConfig.getNativeGraphicsConfiguration();
   }
 
+++ lets go philosophical!

20151005 22:49:12 <xranby_f22> reading comments... so if AWT can make our GL* dipose before our dispose is run... that would make out attempt to lock the surface before disposing it to fail as well.. ?
20151005 22:49:39 <sgothel> that is a good philosophical question :)
20151005 22:49:45 <sgothel> and I made the same ..
20151005 22:50:04 <sgothel> point here is, removeNotify() shall get called _before_ native destruction
20151005 22:50:18 <sgothel> in reality (moving window ..) it is coming later .. it seems
20151005 22:50:32 <sgothel> however .. the resources must stay intact until finished
20151005 22:50:42 <sgothel> similar to 'windowClosing ..'
20151005 22:51:10 <sgothel> only after removeNotify() .. AWT should let go of resources
20151005 22:51:13 <sgothel> (native peer)
20151005 22:51:53 <sgothel> the issue is really that AWT doesn't realize that they could keep the stuff alive
Comment 6 Xerxes Rånby 2015-10-06 12:02:52 CEST
(In reply to Xerxes Rånby from comment #5)
> The NPE seen in Comment 2 and Comment 3 indicate that awtConfig is null in
> JAWTWindow
> 
> likely caused by AWT has sent an dispose before we (jogl) gets to dispose

the only ways for awtConfig to be null is by calling
A) invalidate()
and
B) someone passing a null using setAWTGraphicsConfiguration()
Comment 7 Sven Gothel 2015-10-06 18:45:46 CEST
Bug 1198 is already closed - no issue - and really is unrelated,
there is no deadlock at all.
Comment 8 Sven Gothel 2015-10-06 18:48:17 CEST
(In reply to Xerxes Rånby from comment #5)
> The NPE seen in Comment 2 and Comment 3 indicate that awtConfig is null in
> JAWTWindow
> 
> likely caused by AWT has sent an dispose before we (jogl) gets to dispose
> 
> adding null pointer checks in the two methods is trivial, however i dont
> think that is the right solution because the window should not have been
> disposed while it is still active and visible!

Maybe that detail is what makes you think this bug is related to Bug 1198.
Sure .. that is the current behavior of AWT (not us),
and there is nothing we can do about it.

However, the deadlock shall be avoided despite this behavior.
Comment 9 Sven Gothel 2015-10-06 18:54:45 CEST
(In reply to Xerxes Rånby from comment #5)
> The NPE seen in Comment 2 and Comment 3 indicate that awtConfig is null in
> JAWTWindow

This alone promotes this bug report for 2.3.2,
since it is quite sloppy to use a filed in JAWTWindow
w/ unusable state.

JAWTWindow itself is essential.

And yes, we have to triage this issue in more detail
and setup constrains about awtConfig field.
Comment 10 Xerxes Rånby 2015-10-07 01:40:17 CEST
http://jogamp.org/log/irc/jogamp_20151006050515.html#l349

20151006 21:39:53 <sgothel> my suggestion: if set to null other than invalidate -> exception
20151006 21:40:11 <sgothel> then at lock .. if null -> exception
20151006 21:40:20 <sgothel> then we need to fix that NEWT.AWT driver
20151006 21:40:43 <sgothel> i.e. going the constraint way .. properly defining awtConfig lifecycle
20151006 21:41:00 <sgothel> as you mentioned: it shall not be null

branch ready to merge:  if set to null other than invalidate -> exception
https://github.com/xranby/jogl/commits/Bug1247

With this change we replace the NPE with the new exception:
>> GearsES2 0x53bd815b, angle 0.0, [l -1.33125, r 1.33125, b -1.0, t 1.0] 2.6625x2.0 -> [l -1.33125, r 1.33125, b -1.0, t 1.0] 2.6625x2.0, v-flip false
*** AWTRobotUtil: UncaughtException (this Thread main-AWTAnimator#00) : Thread <main-AWTAnimator#00>, com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: com.jogamp.nativewindow.NativeWindowException: Error: Can't lock surface, JAWTWindow has been invalidated
com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: com.jogamp.nativewindow.NativeWindowException: Error: Can't lock surface, JAWTWindow has been invalidated
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:92)
	at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
	at com.jogamp.opengl.util.Animator$MainLoop.run(Animator.java:204)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.jogamp.nativewindow.NativeWindowException: Error: Can't lock surface, JAWTWindow has been invalidated
	at com.jogamp.nativewindow.awt.JAWTWindow.lockSurface(JAWTWindow.java:680)
	at jogamp.opengl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:307)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:602)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:586)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1279)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
	... 3 more
*** AWTRobotUtil: UncaughtException (this Thread AWT-EventQueue-0) : Thread <AWT-EventQueue-0>, com.jogamp.nativewindow.NativeWindowException: Error: JAWTWindow has been invalidated
com.jogamp.nativewindow.NativeWindowException: Error: JAWTWindow has been invalidated
	at com.jogamp.nativewindow.awt.JAWTWindow.getGraphicsConfiguration(JAWTWindow.java:781)
	at jogamp.opengl.GLDrawableImpl.getChosenGLCapabilities(GLDrawableImpl.java:131)
	at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:243)
	at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119)
	at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141)
	at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4347)
	at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4281)
	at jogamp.newt.WindowImpl.sizeChanged(WindowImpl.java:4467)
	at jogamp.newt.driver.awt.WindowDriver.access$500(WindowDriver.java:65)
	at jogamp.newt.driver.awt.WindowDriver$LocalWindowListener.windowResized(WindowDriver.java:312)
	at com.jogamp.newt.event.awt.AWTWindowAdapter.componentResized(AWTWindowAdapter.java:144)
	at java.awt.AWTEventMulticaster.componentResized(AWTEventMulticaster.java:159)
	at java.awt.Component.processComponentEvent(Component.java:6351)
	at java.awt.Component.processEvent(Component.java:6305)
	at java.awt.Component.dispatchEventImpl(Component.java:4881)
	at java.awt.Component.dispatchEvent(Component.java:4703)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	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)
*** AWTRobotUtil: UncaughtException (this Thread AWT-EventQueue-0) : Thread <AWT-EventQueue-0>, com.jogamp.nativewindow.NativeWindowException: Error: JAWTWindow has been invalidated
com.jogamp.nativewindow.NativeWindowException: Error: JAWTWindow has been invalidated
	at com.jogamp.nativewindow.awt.JAWTWindow.getGraphicsConfiguration(JAWTWindow.java:781)
	at jogamp.opengl.GLDrawableImpl.getChosenGLCapabilities(GLDrawableImpl.java:131)
	at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:243)
	at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119)
	at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141)
	at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4347)
	at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4281)
	at jogamp.newt.WindowImpl.sizeChanged(WindowImpl.java:4467)
	at jogamp.newt.driver.awt.WindowDriver.access$500(WindowDriver.java:65)
	at jogamp.newt.driver.awt.WindowDriver$LocalWindowListener.windowResized(WindowDriver.java:312)
	at com.jogamp.newt.event.awt.AWTWindowAdapter.componentResized(AWTWindowAdapter.java:144)
	at java.awt.AWTEventMulticaster.componentResized(AWTEventMulticaster.java:159)
	at java.awt.Component.processComponentEvent(Component.java:6351)
	at java.awt.Component.processEvent(Component.java:6305)
	at java.awt.Component.dispatchEventImpl(Component.java:4881)
	at java.awt.Component.dispatchEvent(Component.java:4703)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	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)
*** AWTRobotUtil: UncaughtException (this Thread AWT-EventQueue-0) : Thread <AWT-EventQueue-0>, com.jogamp.nativewindow.NativeWindowException: Error: JAWTWindow has been invalidated
com.jogamp.nativewindow.NativeWindowException: Error: JAWTWindow has been invalidated
	at com.jogamp.nativewindow.awt.JAWTWindow.getGraphicsConfiguration(JAWTWindow.java:781)
	at jogamp.opengl.GLDrawableImpl.getChosenGLCapabilities(GLDrawableImpl.java:131)
	at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:243)
	at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119)
	at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141)
	at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4347)
	at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4281)
	at jogamp.newt.WindowImpl.sizeChanged(WindowImpl.java:4467)
	at jogamp.newt.driver.awt.WindowDriver.access$500(WindowDriver.java:65)
	at jogamp.newt.driver.awt.WindowDriver$LocalWindowListener.windowResized(WindowDriver.java:312)
	at com.jogamp.newt.event.awt.AWTWindowAdapter.componentResized(AWTWindowAdapter.java:144)
	at java.awt.AWTEventMulticaster.componentResized(AWTEventMulticaster.java:159)
	at java.awt.Component.processComponentEvent(Component.java:6351)
	at java.awt.Component.processEvent(Component.java:6305)
	at java.awt.Component.dispatchEventImpl(Component.java:4881)
	at java.awt.Component.dispatchEvent(Component.java:4703)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	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)
++++ TestCase.tearDown: com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper - test01
++++ Test Singleton.unlock()
Comment 11 Sven Gothel 2015-10-09 06:16:33 CEST
commit 108ff459c21ef04e541c714658b6b18f28e3c748
  Align NEWT AWT driver w/ GLCanvas (not fixing any issues)

commit 0abf3c058b1ad7f43328a79098890149e6fa8a14
  Enhance JAWTWindow DEBUG output (not fixing any issues)

commit 78bb597a06180c968ff5a10a7e3f44bd058965d6
  JAWTWindow fail early w/ useful info: setAWTGraphicsConfiguration(..) 
  if awtConfig is null, getGraphicsConfiguration() if awtConfig is null

commit c1594efa78951f187a75ec0b9a85cf64fba418d4
  TestGearsNewtAWTWrapper fails AWT recreation case removeNotify -> addNotify,
  e.g. by moving to other monitor
    
    AWTCanvas removeNotify didn't cause 'local' destruction of the NEWT window,
    allowing a 'recreate' w/ subsequent addNotify.
    
    This case has been hacked-into NEWT.AWT.WindowDriver + AWTCanvas:
      - suppression of window destroy events
      - keeping fields/states intact in NEWT.AWT.WindowDriver
      - propagating signals appropriately
    
    Note: This is barely a working hack and not a fine piece of software :)
    
    This AWT backend driver exists only due to historical reasons.
    
    This hack simply proves that JAWTWindow works properly.