Bug 670

Summary: Regression: Drawable already added to animator
Product: [JogAmp] Newt Reporter: Xerxes Rånby <xerxes>
Component: x11Assignee: Sven Gothel <sgothel>
Status: RESOLVED INVALID    
Severity: enhancement    
Priority: ---    
Version: 1   
Hardware: All   
OS: all   
Type: --- SCM Refs:
Workaround: ---

Description Xerxes Rånby 2013-01-19 01:41:37 CET
Testcase:
java -cp jogl-demos/jar/jogl-demos.jar:jogamp-all-platforms/jar/jogl-all.jar:jogamp-all-platforms/jar/gluegen-rt.jar:jogamp-all-platforms/jar/jogl-test.jar:/usr/share/java/junit.jar RawGL2ES2demo

Testsystem:
Ubuntu 12.04 i386 using Mesa GL drivers
1280x1024 monitor
The testcase tries to open a 1920x1080 resolution decides to rezise the window to match monitor, the demo sucessfully renders the first frame visible then hits the Drawable already added to animator exception.

Regression introduced between 1 Jan 2013 and 11 Jan 2013:
1 Jan 2013 is OK
http://jogamp.org/deployment/archive/master/gluegen_619-joal_384-jogl_885-jocl_725/archive/

11 jan 2013 hits this bug
http://jogamp.org/deployment/archive/master/gluegen_620-joal_385-jogl_888-jocl_728/

15 jan 2015 hits this bug
http://jogamp.org/deployment/archive/master/gluegen_624-joal_389-jogl_896-jocl_735/

Output:
familjen@familjen:~/jogamp/test/11jan$ java -cp jogl-demos/jar/jogl-demos.jar:jogamp-all-platforms/jar/jogl-all.jar:jogamp-all-platforms/jar/gluegen-rt.jar:jogamp-all-platforms/jar/jogl-test.jar:/usr/share/java/junit.jar RawGL2ES2demo
Chosen GLCapabilities: GLCaps[glx vid 0x6a, fbc 0x81: rgba 0x8/8/8/8, trans-rgba 0xff/ff/ff/ff, accum-rgba 0/0/0/0, dp/st/ms: 24/8/0, dbl, mono  , hw, GLProfile[GL2ES2/GL2.hw], on-scr[.]]
INIT GL IS: jogamp.opengl.gl4.GL4bcImpl
GL_VENDOR: X.Org
GL_RENDERER: Gallium 0.4 on AMD RV770
GL_VERSION: 2.1 Mesa 8.0.4
Horray! vertex shader compiled
Horray! fragment shader compiled
Window resized to width=1213 height=970
Exception in thread "main" java.lang.IllegalArgumentException: Drawable already added to animator: com.jogamp.opengl.util.Animator[started false, animating false, paused false, drawable 1, totals[dt 0, frames 0, fps 0.0], modeBits 1, init'ed true, animThread null, exclCtxThread false(null)], NEWT-GLWindow[ 
	Helper: GLAnimatorControl: com.jogamp.opengl.util.Animator[started false, animating false, paused false, drawable 1, totals[dt 0, frames 0, fps 0.0], modeBits 1, init'ed true, animThread null, exclCtxThread false(null)], GLEventListeners num 1 [RawGL2ES2demo@13f991[init true], ], 
	Drawable: X11OnscreenGLXDrawable[Realized true,
	Factory   jogamp.opengl.x11.glx.X11GLXDrawableFactory@19bfb30,
	Handle    0x4c00002,
	Surface   jogamp.newt.driver.x11.WindowDriver[Config X11GLXGraphicsConfiguration[X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7b8eac90, ResourceToolkitLock[obj 0x1884174, isOwner false, <814013, 195d4fe>[count 1, qsz 0, owner <main-Display-.x11_:0-1-EDT-1>]]], idx 0], visualID 0x6a, fbConfigID 0x81,
	requested GLCaps[rgba 0x8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2ES2/GL2.hw], on-scr[.]],
	chosen    GLCaps[glx vid 0x6a, fbc 0x81: rgba 0x8/8/8/8, trans-rgba 0xff/ff/ff/ff, accum-rgba 0/0/0/0, dp/st/ms: 24/8/0, dbl, mono  , hw, GLProfile[GL2ES2/GL2.hw], on-scr[.]]]
, NEWT-Screen[.x11_:0-1-s0, idx 0, refCount 1, 1280x1024, X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7a660830, ResourceToolkitLock[obj 0x1d2b01b, isOwner false, <127fa12, 192c8d9>[count 0, qsz 0, owner <NULL>]]], idx 0], NEWT-Display[.x11_:0-1, excl false, refCount 1, hasEDT true, edtRunning true, X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7a660830, ResourceToolkitLock[obj 0x1d2b01b, isOwner false, <127fa12, 192c8d9>[count 0, qsz 0, owner <NULL>]]]]]
, ParentWindow null
, ParentWindowHandle 0x0 (false)
, WindowHandle 0x4c00002
, SurfaceHandle 0x4c00002 (lockedExt window true, surface true)
, Pos 0/0 (auto false), size 1213x970
, Visible true, focus true
, Undecorated false (false)
, AlwaysOnTop false, Fullscreen false
, WrappedWindow null
, ChildWindows 0, SurfaceUpdatedListeners num 0 [], WindowListeners num 1 [com.jogamp.newt.opengl.GLWindow$1@1c05ffd, ], MouseListeners num 0 [], KeyListeners num 0 [], windowLock <de1b8a, 1e232b5>[count 2, qsz 0, owner <main-Display-.x11_:0-1-EDT-1>], surfaceLockCount 1]], 
	Context: X11OnscreenGLXContext [OpenGL 2.1, options 0x302, 2.1 (Compatibility profile, ES2 compatible, FBO, hardware) - 2.1 Mesa 8.0.4, this 0x13785d3, handle 0x7b875448, jogamp.opengl.gl4.GL4bcImpl@16f144c,
	 quirks: [NoDoubleBufferedPBuffer, NoSetSwapIntervalPostRetarget],
	Drawable: X11OnscreenGLXDrawable[Realized true,
	Factory   jogamp.opengl.x11.glx.X11GLXDrawableFactory@19bfb30,
	Handle    0x4c00002,
	Surface   jogamp.newt.driver.x11.WindowDriver[Config X11GLXGraphicsConfiguration[X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7b8eac90, ResourceToolkitLock[obj 0x1884174, isOwner false, <814013, 195d4fe>[count 1, qsz 0, owner <main-Display-.x11_:0-1-EDT-1>]]], idx 0], visualID 0x6a, fbConfigID 0x81,
	requested GLCaps[rgba 0x8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2ES2/GL2.hw], on-scr[.]],
	chosen    GLCaps[glx vid 0x6a, fbc 0x81: rgba 0x8/8/8/8, trans-rgba 0xff/ff/ff/ff, accum-rgba 0/0/0/0, dp/st/ms: 24/8/0, dbl, mono  , hw, GLProfile[GL2ES2/GL2.hw], on-scr[.]]]
, NEWT-Screen[.x11_:0-1-s0, idx 0, refCount 1, 1280x1024, X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7a660830, ResourceToolkitLock[obj 0x1d2b01b, isOwner false, <127fa12, 192c8d9>[count 0, qsz 0, owner <NULL>]]], idx 0], NEWT-Display[.x11_:0-1, excl false, refCount 1, hasEDT true, edtRunning true, X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7a660830, ResourceToolkitLock[obj 0x1d2b01b, isOwner false, <127fa12, 192c8d9>[count 0, qsz 0, owner <NULL>]]]]]
, ParentWindow null
, ParentWindowHandle 0x0 (false)
, WindowHandle 0x4c00002
, SurfaceHandle 0x4c00002 (lockedExt window true, surface true)
, Pos 0/0 (auto false), size 1213x970
, Visible true, focus true
, Undecorated false (false)
, AlwaysOnTop false, Fullscreen false
, WrappedWindow null
, ChildWindows 0, SurfaceUpdatedListeners num 0 [], WindowListeners num 1 [com.jogamp.newt.opengl.GLWindow$1@1c05ffd, ], MouseListeners num 0 [], KeyListeners num 0 [], windowLock <de1b8a, 1e232b5>[count 2, qsz 0, owner <main-Display-.x11_:0-1-EDT-1>], surfaceLockCount 1]], direct true] , 
	Window: jogamp.newt.driver.x11.WindowDriver[Config X11GLXGraphicsConfiguration[X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7b8eac90, ResourceToolkitLock[obj 0x1884174, isOwner false, <814013, 195d4fe>[count 1, qsz 0, owner <main-Display-.x11_:0-1-EDT-1>]]], idx 0], visualID 0x6a, fbConfigID 0x81,
	requested GLCaps[rgba 0x8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2ES2/GL2.hw], on-scr[.]],
	chosen    GLCaps[glx vid 0x6a, fbc 0x81: rgba 0x8/8/8/8, trans-rgba 0xff/ff/ff/ff, accum-rgba 0/0/0/0, dp/st/ms: 24/8/0, dbl, mono  , hw, GLProfile[GL2ES2/GL2.hw], on-scr[.]]]
, NEWT-Screen[.x11_:0-1-s0, idx 0, refCount 1, 1280x1024, X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7a660830, ResourceToolkitLock[obj 0x1d2b01b, isOwner false, <127fa12, 192c8d9>[count 0, qsz 0, owner <NULL>]]], idx 0], NEWT-Display[.x11_:0-1, excl false, refCount 1, hasEDT true, edtRunning true, X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7a660830, ResourceToolkitLock[obj 0x1d2b01b, isOwner false, <127fa12, 192c8d9>[count 0, qsz 0, owner <NULL>]]]]]
, ParentWindow null
, ParentWindowHandle 0x0 (false)
, WindowHandle 0x4c00002
, SurfaceHandle 0x4c00002 (lockedExt window true, surface true)
, Pos 0/0 (auto false), size 1213x970
, Visible true, focus true
, Undecorated false (false)
, AlwaysOnTop false, Fullscreen false
, WrappedWindow null
, ChildWindows 0, SurfaceUpdatedListeners num 0 [], WindowListeners num 1 [com.jogamp.newt.opengl.GLWindow$1@1c05ffd, ], MouseListeners num 0 [], KeyListeners num 0 [], windowLock <de1b8a, 1e232b5>[count 2, qsz 0, owner <main-Display-.x11_:0-1-EDT-1>], surfaceLockCount 1]]
	at com.jogamp.opengl.util.AnimatorBase.add(AnimatorBase.java:179)
	at RawGL2ES2demo.main(RawGL2ES2demo.java:286)
Window resized to width=1215 height=1000
X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 2/2, reusable (open, marked uncloseable): 0, pending (open in creation order): 2)
X11Util: Open X11 Display Connections: 2
X11Util: Open[0]: NamedX11Display[:0, 0x7a660830, refCount 1, unCloseable false]
X11Util: Open[1]: NamedX11Display[:0, 0x7b8eac90, refCount 1, unCloseable false]


Expected output:
~/jogamp/test/1jan$ java -cp jogl-demos/jar/jogl-demos.jar:jogamp-all-platforms/jar/jogl-all.jar:jogamp-all-platforms/jar/gluegen-rt.jar:jogamp-all-platforms/jar/jogl-test.jar:/usr/share/java/junit.jar RawGL2ES2demo
Chosen GLCapabilities: GLCaps[glx vid 0x6a, fbc 0x81: rgba 0x8/8/8/8, trans-rgba 0xff/ff/ff/ff, accum-rgba 0/0/0/0, dp/st/ms: 24/8/0, dbl, mono  , hw, GLProfile[GL2ES2/GL2.hw], on-scr[.]]
INIT GL IS: jogamp.opengl.gl4.GL4bcImpl
GL_VENDOR: X.Org
GL_RENDERER: Gallium 0.4 on AMD RV770
GL_VERSION: 2.1 Mesa 8.0.4
Horray! vertex shader compiled
Horray! fragment shader compiled
Window resized to width=1213 height=970
Window resized to width=1215 height=1000
cleanup, remember to release shaders
X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 2/2, reusable (open, marked uncloseable): 0, pending (open in creation order): 2)
X11Util: Open X11 Display Connections: 2
X11Util: Open[0]: NamedX11Display[:0, 0x8c7e080, refCount 1, unCloseable false]
X11Util: Open[1]: NamedX11Display[:0, 0x8c7e9c8, refCount 1, unCloseable false]
Comment 1 Xerxes Rånby 2013-01-19 01:43:44 CET
Note that the exception triggers in between the two window resize
Window resized to width=1213 height=970
<exception>
Window resized to width=1215 height=1000

I am using the Ubuntu Unity window-manager
Comment 2 Sven Gothel 2013-01-19 01:48:01 CET
GLAnimatorControl.add(..) says:
  @throws IllegalArgumentException if drawable was already added to this animator