LWJGL
May 21, 2013, 03:49:06 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: [FIXED] Display.update() when using canvas causes deadlock on Linux  (Read 2793 times)
Momoko_Fan
Newbie
*
Posts: 34

jME3 lead developer


« on: June 08, 2011, 17:00:22 »

There's a deadlock happening on Linux when canvas is used
http://jmonkeyengine.org/groups/general-2/forum/topic/deadlock-in-swingcanvastest/#post-129936

Apparently it is because LinuxDisplay is calling Component.setFocused() outside of the EDT which is not allowed.

From what I see this is a bug in LWJGL, and not jME3, since Display.update() isn't supposed to be used in the EDT. Am I right?
Logged

Matzon
Administrator
Demigod
*****
Posts: 2237



« Reply #1 on: June 08, 2011, 22:43:27 »

This looks like a bug. Have you tried to manually change it, and confirm the deadlock goes away?
Logged

kappa
Administrator
Nerdus Imperius
*****
Posts: 1112



« Reply #2 on: June 09, 2011, 15:53:40 »

all the setFocusable(boolean) calls in LinuxDisplay now run on the EDT, hopefully this should fix the issue, do try the nightly builds to confirm if it works.
Logged
WindPower
Newbie
*
Posts: 1


« Reply #3 on: June 20, 2011, 12:44:26 »

It is not fully fixed Sad It hangs at another point now; see the jME thread for the stack trace.
Logged
Matzon
Administrator
Demigod
*****
Posts: 2237



« Reply #4 on: June 20, 2011, 21:56:37 »

since we don't have anything to go by, please consider changing the LWJGL code as appropriate and provide a patch.
Logged

kappa
Administrator
Nerdus Imperius
*****
Posts: 1112



« Reply #5 on: June 25, 2011, 19:00:38 »

The relevant focus handling code in LinuxDisplay has been rewritten so this should be fixed properly now. Removed the hacks and all EDT related code, like the calls to Canvas.setFocusable(). As a side effect the focus behaviour for lwjgl applets in the browser on linux should also work much better than before.

Do test nightly builds to see if the deadlock is gone now.
Logged
Axiomatic
Newbie
*
Posts: 2


« Reply #6 on: October 17, 2011, 07:47:51 »

The relevant focus handling code in LinuxDisplay has been rewritten so this should be fixed properly now. Removed the hacks and all EDT related code, like the calls to Canvas.setFocusable(). As a side effect the focus behaviour for lwjgl applets in the browser on linux should also work much better than before.

Do test nightly builds to see if the deadlock is gone now.

I am trying to use the current libgdx + TWL + lwjgl (2.7.1) and I get

Code:
Exception in thread "AWT-EventQueue-0" java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1025)
at org.lwjgl.opengl.LinuxDisplay.edtSetCanvasFocus(LinuxDisplay.java:915)
at org.lwjgl.opengl.LinuxDisplay.setFocused(LinuxDisplay.java:905)
at org.lwjgl.opengl.LinuxDisplay.processEvents(LinuxDisplay.java:762)
at org.lwjgl.opengl.LinuxDisplay.update(LinuxDisplay.java:797)
at org.lwjgl.opengl.Display.processMessages(Display.java:634)
at org.lwjgl.opengl.Display.update(Display.java:692)
at org.lwjgl.opengl.Display.update(Display.java:662)
at com.badlogic.gdx.backends.lwjgl.LwjglCanvas$2.run(LwjglCanvas.java:165)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Would you mean that the fix is available only on LWJGL 2.8.x ?
Logged
kappa
Administrator
Nerdus Imperius
*****
Posts: 1112



« Reply #7 on: October 17, 2011, 08:01:57 »

Would you mean that the fix is available only on LWJGL 2.8.x ?
yes.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!