GLWindow.setSize exception upgrading to rc8

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

GLWindow.setSize exception upgrading to rc8

jouvieje
I trying to upgrade to rc8 from jogl 661.

When my application is starting, the frame is resized. Now with rc8, using a NewtCanvasAWT prevents my application from starting by the exception below which shows up after a 5s freeze (screenshop during the freeze).
rc6 and rc7 also show this problem.

I'm running Windows 7 64 bit with a NVidia GTX 260 with drivers up to date (296.10).

Using GLCanvas instead of NEWT solve the problem, ie everything start properly and no freeze, but would be better if I could fix the exception with newt.
Is someone have seen this problem or have a suggestion to fix it ?

Exception in thread "RenderLoop-0" java.lang.RuntimeException: Waited 5000ms for: <7ef3de76, 2b521f12>[count 1, qsz 0, owner <RenderLoop-0>] - <main-Display-Windows_nil-1-EDT-1>
	at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:182)
	at jogamp.opengl.GLContextImpl.lockConsiderFailFast(GLContextImpl.java:238)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:393)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:415)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:364)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:560)
	at com.jogamp.newt.opengl.GLWindow$1.windowResized(GLWindow.java:91)
	at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:2314)
	at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:2257)
	at jogamp.newt.WindowImpl.sizeChanged(WindowImpl.java:2401)
	at jogamp.newt.driver.windows.WindowsWindow.reconfigureWindow0(Native Method)
	at jogamp.newt.driver.windows.WindowsWindow.reconfigureWindowImpl(WindowsWindow.java:201)
	at jogamp.newt.WindowImpl$SetSizeAction.run(WindowImpl.java:821)
	at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:193)
	at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1578)
	at jogamp.newt.WindowImpl.setSize(WindowImpl.java:844)
	at com.jogamp.newt.opengl.GLWindow.setSize(GLWindow.java:340)
	at jogamp.newt.awt.event.AWTParentWindowAdapter$1.run(AWTParentWindowAdapter.java:101)
	at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:116)
	at jogamp.newt.DefaultEDTUtil$EventDispatchThread.run(DefaultEDTUtil.java:295)
java.lang.RuntimeException: Waited 5000ms for: <7ef3de76, 3c925617>[count 1, qsz 0, owner <main-Display-Windows_nil-1-EDT-1>] - <RenderLoop-0>
	at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:182)
	at jogamp.newt.WindowImpl.lockSurface(WindowImpl.java:562)
	at jogamp.opengl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:195)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:397)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:415)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:364)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:560)
	at jouvieje.scene.target.jogl2.NativeCanvas_jogl2.onDisplay(NativeCanvas_jogl2.java:121)
	at jouvieje.opengl.RenderLoop$Loop.run(RenderLoop.java:62)
Jérôme
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

Sven Gothel
Administrator
On 05/06/2012 05:14 PM, jouvieje [via jogamp] wrote:

> I trying to upgrade to rc8 from jogl 661
> <http://jogamp.org/deployment/archive/master/gluegen_494-joal_286-jogl_661-jocl_562/>.
>
>
> When my application is starting, the frame is resized. Now with rc8, using a
> NewtCanvasAWT prevents my application from starting by the exception below
> which shows up after a 5s freeze (screenshop
> <http://jerome.jouvie.free.fr/jogl-rc8-error.png> during the freeze).
> rc6 and rc7 also show this problem.
>
> I'm running Windows 7 64 bit with a NVidia GTX 260 with drivers up to date
> (296.10).
>
> Using GLCanvas instead of NEWT solve the problem, ie everything start properly
> and no freeze, but would be better if I could fix the exception with newt.
> Is someone have seen this problem or have a suggestion to fix it ?
>
Thank you for the report Jérôme,

I am afraid we have a NEWT regression in this case and we shall fix it of course.


Can you provide a test case or at least a very detailed procedure using the existing
tests/demos to reproduce the freeze/starvation ?

In the meantime ..
I guess you are using your own RenderLoop for periodic rendering.
You may like to register it as an GLAnimationControl via GLAutoDrawable:
 "public void setAnimator(GLAnimatorControl animatorControl)"

This will remove GLAutoDrawable's (GLWindow ..) immediate render attempt
(the display() call). This behavior allows fluent rendering in case an animation
is being performed by a registered GLAnimatorControl.

Even though the above will avoid the freeze and allows a more fluent animation,
let's fix the root cause of the freeze :)

~Sven


> Exception in thread "RenderLoop-0" java.lang.RuntimeException: Waited 5000ms for: <7ef3de76, 2b521f12>[count 1, qsz 0, owner <RenderLoop-0>] - <main-Display-Windows_nil-1-EDT-1>
> at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:182)
> at jogamp.opengl.GLContextImpl.lockConsiderFailFast(GLContextImpl.java:238)
> at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:393)
> at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:415)
> at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:364)
> at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:560)
> at com.jogamp.newt.opengl.GLWindow$1.windowResized(GLWindow.java:91)
> at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:2314)
> at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:2257)
> at jogamp.newt.WindowImpl.sizeChanged(WindowImpl.java:2401)
> at jogamp.newt.driver.windows.WindowsWindow.reconfigureWindow0(Native Method)
> at jogamp.newt.driver.windows.WindowsWindow.reconfigureWindowImpl(WindowsWindow.java:201)
> at jogamp.newt.WindowImpl$SetSizeAction.run(WindowImpl.java:821)
> at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:193)
> at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1578)
> at jogamp.newt.WindowImpl.setSize(WindowImpl.java:844)
> at com.jogamp.newt.opengl.GLWindow.setSize(GLWindow.java:340)
> at jogamp.newt.awt.event.AWTParentWindowAdapter$1.run(AWTParentWindowAdapter.java:101)
> at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:116)
> at jogamp.newt.DefaultEDTUtil$EventDispatchThread.run(DefaultEDTUtil.java:295)
> java.lang.RuntimeException: Waited 5000ms for: <7ef3de76, 3c925617>[count 1, qsz 0, owner <main-Display-Windows_nil-1-EDT-1>] - <RenderLoop-0>
> at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:182)
> at jogamp.newt.WindowImpl.lockSurface(WindowImpl.java:562)
> at jogamp.opengl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:195)
> at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:397)
> at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:415)
> at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:364)
> at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:560)
> at jouvieje.scene.target.jogl2.NativeCanvas_jogl2.onDisplay(NativeCanvas_jogl2.java:121)
> at jouvieje.opengl.RenderLoop$Loop.run(RenderLoop.java:62)
>
> Jérôme
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/GLWindow-setSize-exception-upgrading-to-rc8-tp3966421.html
>
> To start a new topic under jogl, email [hidden email]
> To unsubscribe from jogl, click here
> <
> NAML
> <
http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

--
health & wealth
mailto:[hidden email] ; http://jausoft.com
land : +49 (471) 4707742 ; fax : +49 (471) 4707741
Timezone CET: PST+9, EST+6, UTC+1


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

jouvieje
I have tested using a GLAnimationControl to register my own RenderLoop, and the freeze is in fact gone with that.
One question about GLAnimationControl, is it necessary to implements FPSCounter methods ? Returning 0 to all fps getter seem to work fine, but I'm wondering if it's ok do to that.

Basically, my setup is a NewtCanvasAWT inside a frame/jframe. RenderLoop calls GLWindow.display in it's own thread. The frame is resize in some other thread I've created. And it seem AWTParentWindowAdapter runs the newt window resize in it's own EDT thread, which seems to dislike my RenderLoop locking the surface.

I'll try to write a test case to reproduce this freeze.
Would it be usefull to you if I send you the binary of my application which reproduce the freeze ?
Jérôme
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

gouessej
Administrator
Jérôme, do you reproduce this bug on other platforms? Please can you try to reproduce your bug with build 688, 716, 724 and 749 available here?
http://jogamp.org/deployment/archive/master/
It would be helpful to determine when this regression appeared.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

jouvieje
I can't really say on other platform, I currently only use jogl on my desktop windows machine.
As said above, I can send you a build of my app if you wish to test on linux. I'll write a test case too, but it's not ready yet.

688: OK
716: KO
724: KO
749: Not tried
Jérôme
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

Sven Gothel
Administrator
In reply to this post by jouvieje
On 05/08/2012 09:25 AM, jouvieje [via jogamp] wrote:
> I have tested using a GLAnimationControl to register my own RenderLoop, and
> the freeze is in fact gone with that.
Great to hear.

> One question about GLAnimationControl, is it necessary to implements
> FPSCounter methods ? Returning 0 to all fps getter seem to work fine, but I'm
> wondering if it's ok do to that.
Since you are the 'user' of your implementation, it's OK of course.
You can also utilize 'FPSCounterImpl' from within your implementation
as it is currently used in GLAnimator etc.

>
> Basically, my setup is a NewtCanvasAWT inside a frame/jframe. RenderLoop calls
> GLWindow.display in it's own thread. The frame is resize in some other thread
> I've created. And it seem AWTParentWindowAdapter runs the newt window resize
> in it's own EDT thread, which seems to dislike my RenderLoop locking the surface.
>
I already have thought about the root cause and it seems to be a regression
of GLWindow related to the NativeSurface/GLContext lock order.

GLContext.makeCurrent() locks in the following order:
  1 - GLContext
  2 - GLDrawable/NativeSurface

where the NativeSurfaces (Window, GLWindow, ..) lock only itself.

The makeCurrent() cannot complete, since the NativeSurface is already locked
by another thread. If it would have waited for the NativeSurface lock before
claiming the context lock no stavation would occur.

GLContext shall always lock it's surface 1st,
then it's own lock. The latter depends on the former and is the natural
locking order which plays along w/ other use-cases like resize.

This implies that the 'GLContext.setSynchronized(false)' case is somewhat
unusable, since we should hold the NativeSurface lock first.

> I'll try to write a test case to reproduce this freeze.
> Would it be usefull to you if I send you the binary of my application which
> reproduce the freeze ?

Thank you Jerome, I guess it's not necessary since the starvation / deadlock
is understood now. I will provide a fix w/ unit tests soon.

~Sven

> Jérôme


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

Sven Gothel
Administrator
Fixed 'GLContext/Surface Deadlock', which also simplifies GLContext locking
and removes the '[is/set]Synchronized()' GLContext functions.

http://jogamp.org/git/?p=jogl.git;a=commit;h=78d9e7c84f03ac7b83ad2933cac884ce9ecac161
http://jogamp.org/git/?p=jogl.git;a=commit;h=df6c9accd84b801d86c8f6f9ce35e02ffd417f71
AB
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

AB
I am a newbie with JOGL programming. I am basically trying to plot a 3D cube and track movement of my hand by plotting the coordinates which I get from Leap Motion deivce.

My program was running fine, but today I started getting this error (program runs after a 5 second delay):

Exception in thread "Thread-3" java.lang.RuntimeException: Waited 5000ms for: <3303e3d5, 4462cf1d>[count 2 [ add. 0, orig 2], qsz 0, owner <main>, add.owner main-SharedResourceRunner] - <Thread-3>
        at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
        at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:111)
        at javax.media.opengl.GLProfile.getDefaultDevice(GLProfile.java:1782)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:247)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:197)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:187)
        at MSProject.<init>(MSProject.java:39)
        at MyListener.onFrame(MyListener.java:61)
        at com.leapmotion.leap.LeapJNI.SwigDirector_Listener_onFrame(LeapJNI.java:408)


Coiuld anyone please help me and let me know what I should be doing?I do not quite understand
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

gouessej
Administrator
Which version of JOGL do you use? I have a similar stack trace sometimes when running my game within Eclipse.
Julien Gouesse | Personal blog | Website
AB
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

AB
Build version 2.0.2 (I hope I am looking at the correct thing)
AB
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

AB
In reply to this post by gouessej
What needs to be done to get rid of this error?
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow.setSize exception upgrading to rc8

gouessej
Administrator
I get a similar exception here:
https://jogamp.org/bugzilla/show_bug.cgi?id=756

Please provide a minimal test case to reproduce your bug and put it into the bug report above.
Julien Gouesse | Personal blog | Website