Hi,
I’ve been trying to use jME3’s functionality to be embedded inside Swing frames but kept hitting random deadlocks along the road. Thinking it was my code, I tried SwingCanvasTest from the repos, but the same deadlock happens (roughly 33% of the time). I tested it on Windows and Linux (both 64-bit), and it only seems to happen on the latter. Both the jME canvas and the Swing UI become unresponsive.
Stack:
[java]SwingCanvasTest [Java Application]
temp.SwingCanvasTest at localhost:37749 (Suspended)
Daemon System Thread [Signal Dispatcher] (Suspended)
Daemon System Thread [Finalizer] (Suspended)
Object.wait(long) line: not available [native method]
ReferenceQueue<T>.remove(long) line: 133
ReferenceQueue<T>.remove() line: 149
Finalizer$FinalizerThread.run() line: 177
Daemon System Thread [Reference Handler] (Suspended)
Object.wait(long) line: not available [native method]
Reference$Lock(Object).wait() line: 502
Reference$ReferenceHandler.run() line: 133
Daemon System Thread [Java2D Disposer] (Suspended)
Object.wait(long) line: not available [native method]
ReferenceQueue<T>.remove(long) line: 133
ReferenceQueue<T>.remove() line: 149
Disposer.run() line: 143
Thread.run() line: 636
Daemon Thread [AWT-XAWT] (Suspended)
Unsafe.park(boolean, long) line: not available [native method]
LockSupport.park(Object) line: 186
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).parkAndCheckInterrupt() line: 838
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquireQueued(AbstractQueuedSynchronizer$Node, int) line: 871
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquire(int) line: 1201
ReentrantLock$NonfairSync.lock() line: 214
ReentrantLock.lock() line: 290
SunToolkit.awtLock() line: 270
XToolkit.waitForEvents(long) line: not available [native method]
XToolkit.run(boolean) line: 568
XToolkit.run() line: 543
Thread.run() line: 636
Thread [AWT-Shutdown] (Suspended)
Object.wait(long) line: not available [native method]
Object.wait() line: 502
AWTAutoShutdown.run() line: 281
Thread.run() line: 636
Thread [DestroyJavaVM] (Suspended)
Thread [AWT-EventQueue-0] (Suspended)
Unsafe.park(boolean, long) line: not available [native method]
LockSupport.park(Object) line: 186
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).parkAndCheckInterrupt() line: 838
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquireQueued(AbstractQueuedSynchronizer$Node, int) line: 871
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquire(int) line: 1201
ReentrantLock$NonfairSync.lock() line: 214
ReentrantLock.lock() line: 290
SunToolkit.awtLock() line: 270
XInputMethod.createXICNative(long) line: not available [native method]
XInputMethod.createXIC() line: 70
XInputMethod(X11InputMethod).activate() line: 335
InputMethodContext(InputContext).activateInputMethod(boolean) line: 393
InputMethodContext(InputContext).focusGained(Component) line: 337
InputMethodContext(InputContext).dispatchEvent(AWTEvent) line: 244
InputMethodContext.dispatchEvent(AWTEvent) line: 197
JButton(Component).dispatchEventImpl(AWTEvent) line: 4496
JButton(Container).dispatchEventImpl(AWTEvent) line: 2163
JButton(Component).dispatchEvent(AWTEvent) line: 4390
DefaultKeyboardFocusManager(KeyboardFocusManager).redispatchEvent(Component, AWTEvent) line: 1881
DefaultKeyboardFocusManager.typeAheadAssertions(Component, AWTEvent) line: 936
DefaultKeyboardFocusManager.dispatchEvent(AWTEvent) line: 551
JButton(Component).dispatchEventImpl(AWTEvent) line: 4434
JButton(Container).dispatchEventImpl(AWTEvent) line: 2163
JButton(Component).dispatchEvent(AWTEvent) line: 4390
XWindow$1.run() line: 378
PeerEvent(InvocationEvent).dispatch() line: 226
EventQueue.dispatchEventImpl(AWTEvent, Object) line: 647
EventQueue.access$000(EventQueue, AWTEvent, Object) line: 96
EventQueue$1.run() line: 608
EventQueue$1.run() line: 606
AccessController.doPrivileged(PrivilegedAction<T>, AccessControlContext) line: not available [native method]
AccessControlContext$1.doIntersectionPrivilege(PrivilegedAction<T>, AccessControlContext, AccessControlContext) line: 105
EventQueue.dispatchEvent(AWTEvent) line: 617
EventDispatchThread.pumpOneEventForFilters(int) line: 275
EventDispatchThread.pumpEventsForFilter(int, Conditional, EventFilter) line: 200
EventDispatchThread.pumpEventsForHierarchy(int, Conditional, Component) line: 190
EventDispatchThread.pumpEvents(int, Conditional) line: 185
EventDispatchThread.pumpEvents(Conditional) line: 177
EventDispatchThread.run() line: 138
Thread [LWJGL Renderer Thread] (Suspended)
KeyboardFocusManager.clearMostRecentFocusOwner(Component) line: 1810
LwjglCanvas$GLCanvas(Component).setFocusable(boolean) line: 6822
LinuxDisplay.setFocused(boolean, int) line: 904
LinuxDisplay.processEvents() line: 761
LinuxDisplay.update() line: 796
Display.processMessages() line: 634
LwjglCanvas(LwjglAbstractDisplay).runLoop() line: 174
LwjglCanvas.runLoop() line: 199
LwjglCanvas(LwjglAbstractDisplay).run() line: 218
Thread.run() line: 636
Daemon Thread [jME3 Audio Thread] (Suspended)
Thread.sleep(long) line: not available [native method]
LwjglAudioRenderer.run() line: 146
Thread.run() line: 636
/usr/lib/jvm/java-6-openjdk/bin/java (2011-06-08 12:02:38 PM)[/java]
Since I already heard about this issue several times I decided to report it to LWJGL (Most likely it is a bug on their end)
Hopefully we’ll have an answer soon … this might actually fix those jMP freezes on Linux which would be great
Momoko_Fan said:
Since I already heard about this issue several times I decided to report it to LWJGL (Most likely it is a bug on their end)
Hopefully we'll have an answer soon .. this might actually fix those jMP freezes on Linux which would be great
Could you post a link to that bug report? Just so that I can follow it too~
Yes if you can please test the nightly builds of lwjgl to see if the deadlock still happens
That sounds awesome, lets hope the canvas issues go away once and for all with this.
Yes it is great. I hope all the issues are fixed
It is fixed! Thank you.
(Sorry for the double post, I deleted my previous one by accident)