New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL sketches work only after running a sketch with default renderer #3218

Closed
JakubValtar opened this Issue Apr 26, 2015 · 14 comments

Comments

Projects
None yet
3 participants
@JakubValtar
Contributor

JakubValtar commented Apr 26, 2015

This one freezes:

void setup() { size(500, 500, P2D); }
void draw()  { background(0); }

After running a sketch with a default renderer like the following one, the previous one works alright:

void setup() { size(500, 500); }
void draw()  { background(0); }

Processing 3.0a6-windows64
Windows 8.1 64bit, Core i7, GeForce GTX 760M

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Apr 26, 2015

Member

@codeanticode any ideas on this?

Member

benfry commented Apr 26, 2015

@codeanticode any ideas on this?

@benfry benfry added the critical label Apr 26, 2015

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Apr 26, 2015

Member

All I can say at the moment is that seems windows-specific. It does not freeze on OSX. My initial guess is that we are missing some toolkit initialization step in LWJGL, which is done by the AWT surface. I will look into it asap. @JakubValtar let me know if you have any other ideas, the problem here is that we switched from JOGL over to LWJGL recently, and such transition is bound to be somewhat bumpy, hopefully not too much.

Member

codeanticode commented Apr 26, 2015

All I can say at the moment is that seems windows-specific. It does not freeze on OSX. My initial guess is that we are missing some toolkit initialization step in LWJGL, which is done by the AWT surface. I will look into it asap. @JakubValtar let me know if you have any other ideas, the problem here is that we switched from JOGL over to LWJGL recently, and such transition is bound to be somewhat bumpy, hopefully not too much.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Apr 26, 2015

Contributor

Here is a thread dump for you. If you look closely, Thread-3 (mouse), Thread-2 (keyboard) and Animation Thread are all waiting to lock 0x00000000e25885a8, which is currently held by AWT-EventQueue-0. I'd start there.

dump


2015-04-26 16:58:16
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode):

"RMI TCP Connection(3)-10.0.0.55" #31 daemon prio=5 os_prio=0 tid=0x000000000a2ff800 nid=0xfb8 runnable [0x000000000b30e000]
   java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
    at java.net.SocketInputStream.read(SocketInputStream.java:170)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
    - locked <0x00000000e25a0e10> (a java.io.BufferedInputStream)
    at java.io.FilterInputStream.read(FilterInputStream.java:83)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:550)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$254(TCPTransport.java:683)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$6/429382617.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - <0x00000000e25a0f98> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"JMX server connection timeout 29" #29 daemon prio=5 os_prio=0 tid=0x000000000a300800 nid=0x1df0 in Object.wait() [0x000000000db7f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(ServerCommunicatorAdmin.java:168)
    - locked <0x00000000e2592f20> (a [I)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"RMI Scheduler(0)" #28 daemon prio=5 os_prio=0 tid=0x000000000a53a000 nid=0x23e4 waiting on condition [0x000000000da7f000]
   java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x00000000e25a8010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"RMI TCP Accept-0" #26 daemon prio=5 os_prio=0 tid=0x000000000a3b1800 nid=0x2568 runnable [0x000000000d87f000]
   java.lang.Thread.State: RUNNABLE
    at java.net.DualStackPlainSocketImpl.accept0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketAccept(DualStackPlainSocketImpl.java:131)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:404)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:199)
    - locked <0x00000000e25b0138> (a java.net.SocksSocketImpl)
    at java.net.ServerSocket.implAccept(ServerSocket.java:545)
    at java.net.ServerSocket.accept(ServerSocket.java:513)
    at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:52)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:400)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:372)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"LWJGL Timer" #24 daemon prio=6 os_prio=0 tid=0x000000000a333000 nid=0x86c waiting on condition [0x000000000e20f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at org.lwjgl.opengl.Sync$1.run(Sync.java:116)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"Thread-3" #23 prio=6 os_prio=0 tid=0x000000000a26b800 nid=0x14e0 waiting for monitor entry [0x000000000e0df000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at org.lwjgl.input.Mouse.poll(Mouse.java:350)
    - waiting to lock <0x00000000e25885a8> (a java.lang.Object)
    at processing.opengl.PSurfaceLWJGL$MousePoller.run(PSurfaceLWJGL.java:753)

   Locked ownable synchronizers:
    - None

"Thread-2" #22 prio=6 os_prio=0 tid=0x000000000a26b000 nid=0x2404 waiting for monitor entry [0x000000000dfdf000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at org.lwjgl.input.Keyboard.poll(Keyboard.java:385)
    - waiting to lock <0x00000000e25885a8> (a java.lang.Object)
    at processing.opengl.PSurfaceLWJGL$KeyPoller.run(PSurfaceLWJGL.java:663)

   Locked ownable synchronizers:
    - None

"Animation Thread" #21 prio=6 os_prio=0 tid=0x000000000a252000 nid=0x239c waiting for monitor entry [0x000000000b10f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at org.lwjgl.opengl.Display.update(Display.java:640)
    - waiting to lock <0x00000000e25885a8> (a java.lang.Object)
    at org.lwjgl.opengl.Display.update(Display.java:628)
    at processing.opengl.PSurfaceLWJGL$AnimationThread.run(PSurfaceLWJGL.java:555)

   Locked ownable synchronizers:
    - None

"DestroyJavaVM" #19 prio=5 os_prio=0 tid=0x0000000002462800 nid=0x26e4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"AWT-EventQueue-0" #18 prio=6 os_prio=0 tid=0x000000000a22f000 nid=0x1cc4 runnable [0x000000000af1d000]
   java.lang.Thread.State: RUNNABLE
    at org.lwjgl.opengl.WindowsDisplay.nReshape(Native Method)
    at org.lwjgl.opengl.WindowsDisplay.reshape(WindowsDisplay.java:580)
    at org.lwjgl.opengl.Display.reshape(Display.java:1171)
    at org.lwjgl.opengl.Display.setLocation(Display.java:1164)
    - locked <0x00000000e25885a8> (a java.lang.Object)
    at processing.opengl.PSurfaceLWJGL.placeWindow(PSurfaceLWJGL.java:290)
    at processing.core.PApplet.runSketchEDT(PApplet.java:9565)
    at processing.core.PApplet$4.run(PApplet.java:9383)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    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.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    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)

   Locked ownable synchronizers:
    - None

"AWT-Windows" #16 daemon prio=6 os_prio=0 tid=0x000000000a22b800 nid=0x25f8 runnable [0x000000000ac2f000]
   java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WToolkit.eventLoop(Native Method)
    at sun.awt.windows.WToolkit.run(WToolkit.java:306)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"AWT-Shutdown" #15 prio=5 os_prio=0 tid=0x000000000a22a800 nid=0xdc in Object.wait() [0x000000000ab2e000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e25b0288> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:502)
    at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:295)
    - locked <0x00000000e25b0288> (a java.lang.Object)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"Java2D Disposer" #14 daemon prio=10 os_prio=2 tid=0x000000000a225800 nid=0x1ce0 in Object.wait() [0x000000000aa2f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e25885b8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
    - locked <0x00000000e25885b8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
    at sun.java2d.Disposer.run(Disposer.java:148)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"Service Thread" #13 daemon prio=9 os_prio=0 tid=0x0000000009314000 nid=0x2570 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C1 CompilerThread3" #12 daemon prio=9 os_prio=2 tid=0x000000000928a000 nid=0x2774 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C2 CompilerThread2" #11 daemon prio=9 os_prio=2 tid=0x0000000009287000 nid=0x27f8 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C2 CompilerThread1" #10 daemon prio=9 os_prio=2 tid=0x0000000009286800 nid=0x226c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C2 CompilerThread0" #9 daemon prio=9 os_prio=2 tid=0x000000000927f800 nid=0x2180 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"JDWP Command Reader" #8 daemon prio=10 os_prio=0 tid=0x000000000927c800 nid=0x1244 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"JDWP Event Helper Thread" #7 daemon prio=10 os_prio=0 tid=0x000000000926f800 nid=0x26b4 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"JDWP Transport Listener: dt_socket" #6 daemon prio=10 os_prio=0 tid=0x0000000009257000 nid=0x242c runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x0000000009265000 nid=0x229c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x0000000009264000 nid=0x18f4 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x000000000255c800 nid=0x1ac4 in Object.wait() [0x000000000922f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
    - locked <0x00000000e25885f8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

   Locked ownable synchronizers:
    - None

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x000000000722c800 nid=0xf78 in Object.wait() [0x000000000912f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:502)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
    - locked <0x00000000e25b05f8> (a java.lang.ref.Reference$Lock)

   Locked ownable synchronizers:
    - None

"VM Thread" os_prio=2 tid=0x000000000722a800 nid=0x171c runnable 

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000002479000 nid=0x1ecc runnable 

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x000000000247a800 nid=0x25c4 runnable 

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x000000000247c000 nid=0x1b14 runnable 

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x000000000247d800 nid=0x240c runnable 

"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x0000000002480000 nid=0x1d24 runnable 

"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x0000000002481000 nid=0x7d0 runnable 

"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x0000000002484800 nid=0x2518 runnable 

"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x0000000002486800 nid=0x1e9c runnable 

"VM Periodic Task Thread" os_prio=2 tid=0x000000000931f000 nid=0xcb4 waiting on condition 

JNI global references: 2276


Contributor

JakubValtar commented Apr 26, 2015

Here is a thread dump for you. If you look closely, Thread-3 (mouse), Thread-2 (keyboard) and Animation Thread are all waiting to lock 0x00000000e25885a8, which is currently held by AWT-EventQueue-0. I'd start there.

dump


2015-04-26 16:58:16
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode):

"RMI TCP Connection(3)-10.0.0.55" #31 daemon prio=5 os_prio=0 tid=0x000000000a2ff800 nid=0xfb8 runnable [0x000000000b30e000]
   java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
    at java.net.SocketInputStream.read(SocketInputStream.java:170)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
    - locked <0x00000000e25a0e10> (a java.io.BufferedInputStream)
    at java.io.FilterInputStream.read(FilterInputStream.java:83)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:550)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$254(TCPTransport.java:683)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$6/429382617.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - <0x00000000e25a0f98> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"JMX server connection timeout 29" #29 daemon prio=5 os_prio=0 tid=0x000000000a300800 nid=0x1df0 in Object.wait() [0x000000000db7f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(ServerCommunicatorAdmin.java:168)
    - locked <0x00000000e2592f20> (a [I)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"RMI Scheduler(0)" #28 daemon prio=5 os_prio=0 tid=0x000000000a53a000 nid=0x23e4 waiting on condition [0x000000000da7f000]
   java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x00000000e25a8010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"RMI TCP Accept-0" #26 daemon prio=5 os_prio=0 tid=0x000000000a3b1800 nid=0x2568 runnable [0x000000000d87f000]
   java.lang.Thread.State: RUNNABLE
    at java.net.DualStackPlainSocketImpl.accept0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketAccept(DualStackPlainSocketImpl.java:131)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:404)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:199)
    - locked <0x00000000e25b0138> (a java.net.SocksSocketImpl)
    at java.net.ServerSocket.implAccept(ServerSocket.java:545)
    at java.net.ServerSocket.accept(ServerSocket.java:513)
    at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:52)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:400)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:372)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"LWJGL Timer" #24 daemon prio=6 os_prio=0 tid=0x000000000a333000 nid=0x86c waiting on condition [0x000000000e20f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at org.lwjgl.opengl.Sync$1.run(Sync.java:116)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"Thread-3" #23 prio=6 os_prio=0 tid=0x000000000a26b800 nid=0x14e0 waiting for monitor entry [0x000000000e0df000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at org.lwjgl.input.Mouse.poll(Mouse.java:350)
    - waiting to lock <0x00000000e25885a8> (a java.lang.Object)
    at processing.opengl.PSurfaceLWJGL$MousePoller.run(PSurfaceLWJGL.java:753)

   Locked ownable synchronizers:
    - None

"Thread-2" #22 prio=6 os_prio=0 tid=0x000000000a26b000 nid=0x2404 waiting for monitor entry [0x000000000dfdf000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at org.lwjgl.input.Keyboard.poll(Keyboard.java:385)
    - waiting to lock <0x00000000e25885a8> (a java.lang.Object)
    at processing.opengl.PSurfaceLWJGL$KeyPoller.run(PSurfaceLWJGL.java:663)

   Locked ownable synchronizers:
    - None

"Animation Thread" #21 prio=6 os_prio=0 tid=0x000000000a252000 nid=0x239c waiting for monitor entry [0x000000000b10f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at org.lwjgl.opengl.Display.update(Display.java:640)
    - waiting to lock <0x00000000e25885a8> (a java.lang.Object)
    at org.lwjgl.opengl.Display.update(Display.java:628)
    at processing.opengl.PSurfaceLWJGL$AnimationThread.run(PSurfaceLWJGL.java:555)

   Locked ownable synchronizers:
    - None

"DestroyJavaVM" #19 prio=5 os_prio=0 tid=0x0000000002462800 nid=0x26e4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"AWT-EventQueue-0" #18 prio=6 os_prio=0 tid=0x000000000a22f000 nid=0x1cc4 runnable [0x000000000af1d000]
   java.lang.Thread.State: RUNNABLE
    at org.lwjgl.opengl.WindowsDisplay.nReshape(Native Method)
    at org.lwjgl.opengl.WindowsDisplay.reshape(WindowsDisplay.java:580)
    at org.lwjgl.opengl.Display.reshape(Display.java:1171)
    at org.lwjgl.opengl.Display.setLocation(Display.java:1164)
    - locked <0x00000000e25885a8> (a java.lang.Object)
    at processing.opengl.PSurfaceLWJGL.placeWindow(PSurfaceLWJGL.java:290)
    at processing.core.PApplet.runSketchEDT(PApplet.java:9565)
    at processing.core.PApplet$4.run(PApplet.java:9383)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    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.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    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)

   Locked ownable synchronizers:
    - None

"AWT-Windows" #16 daemon prio=6 os_prio=0 tid=0x000000000a22b800 nid=0x25f8 runnable [0x000000000ac2f000]
   java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WToolkit.eventLoop(Native Method)
    at sun.awt.windows.WToolkit.run(WToolkit.java:306)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"AWT-Shutdown" #15 prio=5 os_prio=0 tid=0x000000000a22a800 nid=0xdc in Object.wait() [0x000000000ab2e000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e25b0288> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:502)
    at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:295)
    - locked <0x00000000e25b0288> (a java.lang.Object)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"Java2D Disposer" #14 daemon prio=10 os_prio=2 tid=0x000000000a225800 nid=0x1ce0 in Object.wait() [0x000000000aa2f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e25885b8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
    - locked <0x00000000e25885b8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
    at sun.java2d.Disposer.run(Disposer.java:148)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

"Service Thread" #13 daemon prio=9 os_prio=0 tid=0x0000000009314000 nid=0x2570 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C1 CompilerThread3" #12 daemon prio=9 os_prio=2 tid=0x000000000928a000 nid=0x2774 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C2 CompilerThread2" #11 daemon prio=9 os_prio=2 tid=0x0000000009287000 nid=0x27f8 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C2 CompilerThread1" #10 daemon prio=9 os_prio=2 tid=0x0000000009286800 nid=0x226c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"C2 CompilerThread0" #9 daemon prio=9 os_prio=2 tid=0x000000000927f800 nid=0x2180 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"JDWP Command Reader" #8 daemon prio=10 os_prio=0 tid=0x000000000927c800 nid=0x1244 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"JDWP Event Helper Thread" #7 daemon prio=10 os_prio=0 tid=0x000000000926f800 nid=0x26b4 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"JDWP Transport Listener: dt_socket" #6 daemon prio=10 os_prio=0 tid=0x0000000009257000 nid=0x242c runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x0000000009265000 nid=0x229c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x0000000009264000 nid=0x18f4 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x000000000255c800 nid=0x1ac4 in Object.wait() [0x000000000922f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
    - locked <0x00000000e25885f8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

   Locked ownable synchronizers:
    - None

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x000000000722c800 nid=0xf78 in Object.wait() [0x000000000912f000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:502)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
    - locked <0x00000000e25b05f8> (a java.lang.ref.Reference$Lock)

   Locked ownable synchronizers:
    - None

"VM Thread" os_prio=2 tid=0x000000000722a800 nid=0x171c runnable 

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000002479000 nid=0x1ecc runnable 

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x000000000247a800 nid=0x25c4 runnable 

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x000000000247c000 nid=0x1b14 runnable 

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x000000000247d800 nid=0x240c runnable 

"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x0000000002480000 nid=0x1d24 runnable 

"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x0000000002481000 nid=0x7d0 runnable 

"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x0000000002484800 nid=0x2518 runnable 

"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x0000000002486800 nid=0x1e9c runnable 

"VM Periodic Task Thread" os_prio=2 tid=0x000000000931f000 nid=0xcb4 waiting on condition 

JNI global references: 2276


@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Apr 26, 2015

Contributor

I commented out https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java#L9565 and it seems to be solved. PSurfaceLWJGL#placeWindow(int[] location, int[] editorLocation) seems to be causing troubles.

Contributor

JakubValtar commented Apr 26, 2015

I commented out https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java#L9565 and it seems to be solved. PSurfaceLWJGL#placeWindow(int[] location, int[] editorLocation) seems to be causing troubles.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Apr 26, 2015

Member

I suspect this is the important piece:

java.lang.Thread.State: RUNNABLE
    at org.lwjgl.opengl.WindowsDisplay.nReshape(Native Method)
    at org.lwjgl.opengl.WindowsDisplay.reshape(WindowsDisplay.java:580)
    at org.lwjgl.opengl.Display.reshape(Display.java:1171)
    at org.lwjgl.opengl.Display.setLocation(Display.java:1164)
    - locked <0x00000000e25885a8> (a java.lang.Object)
    at processing.opengl.PSurfaceLWJGL.placeWindow(PSurfaceLWJGL.java:290)
    at processing.core.PApplet.runSketchEDT(PApplet.java:9565)

And that something inside the Display.setLocation() method doesn't expect to be on the EDT, so it's blocking until it is.

Member

benfry commented Apr 26, 2015

I suspect this is the important piece:

java.lang.Thread.State: RUNNABLE
    at org.lwjgl.opengl.WindowsDisplay.nReshape(Native Method)
    at org.lwjgl.opengl.WindowsDisplay.reshape(WindowsDisplay.java:580)
    at org.lwjgl.opengl.Display.reshape(Display.java:1171)
    at org.lwjgl.opengl.Display.setLocation(Display.java:1164)
    - locked <0x00000000e25885a8> (a java.lang.Object)
    at processing.opengl.PSurfaceLWJGL.placeWindow(PSurfaceLWJGL.java:290)
    at processing.core.PApplet.runSketchEDT(PApplet.java:9565)

And that something inside the Display.setLocation() method doesn't expect to be on the EDT, so it's blocking until it is.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Apr 26, 2015

Contributor

So why does it work after running Java2D sketch?

I printed out parameters given to PSurfaceLWJGL#placeWindow(int[] location, int[] editorLocation) and both arrays are null when running from Eclipse. Could that be the issue?

When I try to run a sketch from PDE which I built using ant, it just throws this one into PDE console and does not launch the sketch, so I can't test there.

Can't find/access AST Node typeantlr.ExtendedCommonASTWithHiddenTokens
Exception in thread "Thread-15" java.lang.IllegalAccessError: tried to access method antlr.CommonHiddenStreamToken.setHiddenBefore(Lantlr/CommonHiddenStreamToken;)V from class antlr.TokenStreamCopyingHiddenTokenFilter
    at antlr.TokenStreamCopyingHiddenTokenFilter.nextToken(TokenStreamCopyingHiddenTokenFilter.java:160)
    at antlr.TokenBuffer.fill(TokenBuffer.java:69)
    at antlr.TokenBuffer.LA(TokenBuffer.java:80)
    at antlr.LLkParser.LA(LLkParser.java:52)
    at processing.mode.java.preproc.PdeRecognizer.activeProgram(PdeRecognizer.java:182)
    at processing.mode.java.preproc.PdePreprocessor.write(PdePreprocessor.java:643)
    at processing.mode.java.preproc.PdePreprocessor.write(PdePreprocessor.java:572)
    at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:277)
    at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:192)
    at processing.mode.java.JavaBuild.build(JavaBuild.java:151)
    at processing.mode.java.JavaBuild.build(JavaBuild.java:130)
    at processing.mode.java.JavaMode.handleLaunch(JavaMode.java:151)
    at processing.mode.java.JavaMode.handleRun(JavaMode.java:129)
    at processing.mode.java.JavaEditor$30.run(JavaEditor.java:1029)
    at java.lang.Thread.run(Thread.java:745)

an then these every second:

java.lang.SecurityException: class "org.eclipse.jdt.core.compiler.IScanner"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:895)
    at java.lang.ClassLoader.preDefineClass(ClassLoader.java:665)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:758)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.formatString(ASTRewriteFormatter.java:246)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.formatNode(ASTRewriteFormatter.java:376)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.getFormattedResult(ASTRewriteFormatter.java:187)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doTextInsert(ASTRewriteAnalyzer.java:1339)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:631)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:550)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.rewriteModifiers2(ASTRewriteAnalyzer.java:1539)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1992)
    at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:611)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:405)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:443)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:437)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1675)
    at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:453)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:405)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:443)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:437)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1655)
    at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:207)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.core.dom.InternalASTRewrite.rewriteAST(InternalASTRewrite.java:101)
    at org.eclipse.jdt.core.dom.AST.rewrite(AST.java:3077)
    at org.eclipse.jdt.core.dom.CompilationUnit.rewrite(CompilationUnit.java:929)
    at processing.mode.java.pdex.XQPreprocessor.doYourThing(XQPreprocessor.java:96)
    at processing.mode.java.pdex.ErrorCheckerService.checkCode(ErrorCheckerService.java:510)
    at processing.mode.java.pdex.ErrorCheckerService.run(ErrorCheckerService.java:366)
    at java.lang.Thread.run(Thread.java:745)
Contributor

JakubValtar commented Apr 26, 2015

So why does it work after running Java2D sketch?

I printed out parameters given to PSurfaceLWJGL#placeWindow(int[] location, int[] editorLocation) and both arrays are null when running from Eclipse. Could that be the issue?

When I try to run a sketch from PDE which I built using ant, it just throws this one into PDE console and does not launch the sketch, so I can't test there.

Can't find/access AST Node typeantlr.ExtendedCommonASTWithHiddenTokens
Exception in thread "Thread-15" java.lang.IllegalAccessError: tried to access method antlr.CommonHiddenStreamToken.setHiddenBefore(Lantlr/CommonHiddenStreamToken;)V from class antlr.TokenStreamCopyingHiddenTokenFilter
    at antlr.TokenStreamCopyingHiddenTokenFilter.nextToken(TokenStreamCopyingHiddenTokenFilter.java:160)
    at antlr.TokenBuffer.fill(TokenBuffer.java:69)
    at antlr.TokenBuffer.LA(TokenBuffer.java:80)
    at antlr.LLkParser.LA(LLkParser.java:52)
    at processing.mode.java.preproc.PdeRecognizer.activeProgram(PdeRecognizer.java:182)
    at processing.mode.java.preproc.PdePreprocessor.write(PdePreprocessor.java:643)
    at processing.mode.java.preproc.PdePreprocessor.write(PdePreprocessor.java:572)
    at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:277)
    at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:192)
    at processing.mode.java.JavaBuild.build(JavaBuild.java:151)
    at processing.mode.java.JavaBuild.build(JavaBuild.java:130)
    at processing.mode.java.JavaMode.handleLaunch(JavaMode.java:151)
    at processing.mode.java.JavaMode.handleRun(JavaMode.java:129)
    at processing.mode.java.JavaEditor$30.run(JavaEditor.java:1029)
    at java.lang.Thread.run(Thread.java:745)

an then these every second:

java.lang.SecurityException: class "org.eclipse.jdt.core.compiler.IScanner"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:895)
    at java.lang.ClassLoader.preDefineClass(ClassLoader.java:665)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:758)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.formatString(ASTRewriteFormatter.java:246)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.formatNode(ASTRewriteFormatter.java:376)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.getFormattedResult(ASTRewriteFormatter.java:187)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doTextInsert(ASTRewriteAnalyzer.java:1339)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:631)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:550)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.rewriteModifiers2(ASTRewriteAnalyzer.java:1539)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1992)
    at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:611)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:405)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:443)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:437)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1675)
    at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:453)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:405)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:443)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:437)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:450)
    at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1655)
    at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:207)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.core.dom.InternalASTRewrite.rewriteAST(InternalASTRewrite.java:101)
    at org.eclipse.jdt.core.dom.AST.rewrite(AST.java:3077)
    at org.eclipse.jdt.core.dom.CompilationUnit.rewrite(CompilationUnit.java:929)
    at processing.mode.java.pdex.XQPreprocessor.doYourThing(XQPreprocessor.java:96)
    at processing.mode.java.pdex.ErrorCheckerService.checkCode(ErrorCheckerService.java:510)
    at processing.mode.java.pdex.ErrorCheckerService.run(ErrorCheckerService.java:366)
    at java.lang.Thread.run(Thread.java:745)
@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Apr 26, 2015

Contributor

Sorry, that's useless, didn't notice they are expected to be null sometimes. But the problem is definitely caused by Display.setLocation(). When the sketch is running for the second time, only frame.setLocation(location[0], location[1]) is called, so it could be what you said, it is not expecting to run on EDT.

Contributor

JakubValtar commented Apr 26, 2015

Sorry, that's useless, didn't notice they are expected to be null sometimes. But the problem is definitely caused by Display.setLocation(). When the sketch is running for the second time, only frame.setLocation(location[0], location[1]) is called, so it could be what you said, it is not expecting to run on EDT.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Apr 26, 2015

Member

Those two big stack traces suggest you have bad versions of both antlr.jar and some Eclipse JARs on your classpath that are conflicting with the ones from Processing.

Member

benfry commented Apr 26, 2015

Those two big stack traces suggest you have bad versions of both antlr.jar and some Eclipse JARs on your classpath that are conflicting with the ones from Processing.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Apr 26, 2015

Member

You can also try turning off the EDT launching in PApplet:

  static public void runSketch(final String[] args,
                               final PApplet constructedApplet) {
    //EventQueue.invokeLater(new Runnable() {
    //  public void run() {
        runSketchEDT(args, constructedApplet);
    //  }
    //});
  }

but it may bring back various bits of startup flicker as the window is placed/resized/etc.

Member

benfry commented Apr 26, 2015

You can also try turning off the EDT launching in PApplet:

  static public void runSketch(final String[] args,
                               final PApplet constructedApplet) {
    //EventQueue.invokeLater(new Runnable() {
    //  public void run() {
        runSketchEDT(args, constructedApplet);
    //  }
    //});
  }

but it may bring back various bits of startup flicker as the window is placed/resized/etc.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Apr 26, 2015

Contributor

Thanks, I cloned the whole repository again and I don't get these two stack traces anymore!

I'm running off the EDT with the code in your post but nothing changed.

Contributor

JakubValtar commented Apr 26, 2015

Thanks, I cloned the whole repository again and I don't get these two stack traces anymore!

I'm running off the EDT with the code in your post but nothing changed.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Apr 26, 2015

Member

Hm, maybe you just needed an ant clean.

Bummer about the EDT thing, or maybe that's better, since it points to something else...

Member

benfry commented Apr 26, 2015

Hm, maybe you just needed an ant clean.

Bummer about the EDT thing, or maybe that's better, since it points to something else...

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Apr 26, 2015

Contributor

Tried Processing 3.0a6-windows32, same problem.

Trace ends in LWGJL native code, file src/native/windows/org_lwjgl_opengl_Display.c. This method gets called and one of these lines causes the freeze:

JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReshape(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint x, jint y, jint width, jint height, jboolean undecorated, jboolean child) {
    HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
    DWORD exstyle, windowflags;
    RECT clientSize;

    getWindowFlags(&windowflags, &exstyle, undecorated, child);

    // If we're not a fullscreen window, adjust the height to account for the
    // height of the title bar:
    clientSize.bottom = height;
    clientSize.left = 0;
    clientSize.right = width;
    clientSize.top = 0;

    AdjustWindowRectEx(
      &clientSize,    // client-rectangle structure
      windowflags,    // window styles
      FALSE,          // menu-present option
      exstyle         // extended window style
    );
    SetWindowPos(hwnd, HWND_TOP, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, SWP_NOZORDER);
}

getWindowsFlags is harmless function which just does logical operations, AdjustWindowRectEx calculates window size to accommodate desired content. Only thing I can think of is SetWindowPos, I found some people having deadlocks with it: social.msdn.microsoft.com/...

Maybe we should get in touch with LWJGL guys? This could be a bug in Windows part of their library.

Contributor

JakubValtar commented Apr 26, 2015

Tried Processing 3.0a6-windows32, same problem.

Trace ends in LWGJL native code, file src/native/windows/org_lwjgl_opengl_Display.c. This method gets called and one of these lines causes the freeze:

JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReshape(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint x, jint y, jint width, jint height, jboolean undecorated, jboolean child) {
    HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
    DWORD exstyle, windowflags;
    RECT clientSize;

    getWindowFlags(&windowflags, &exstyle, undecorated, child);

    // If we're not a fullscreen window, adjust the height to account for the
    // height of the title bar:
    clientSize.bottom = height;
    clientSize.left = 0;
    clientSize.right = width;
    clientSize.top = 0;

    AdjustWindowRectEx(
      &clientSize,    // client-rectangle structure
      windowflags,    // window styles
      FALSE,          // menu-present option
      exstyle         // extended window style
    );
    SetWindowPos(hwnd, HWND_TOP, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, SWP_NOZORDER);
}

getWindowsFlags is harmless function which just does logical operations, AdjustWindowRectEx calculates window size to accommodate desired content. Only thing I can think of is SetWindowPos, I found some people having deadlocks with it: social.msdn.microsoft.com/...

Maybe we should get in touch with LWJGL guys? This could be a bug in Windows part of their library.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 16, 2015

Member

@codeanticode This is fixed, right?

Member

benfry commented May 16, 2015

@codeanticode This is fixed, right?

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode
Member

codeanticode commented May 16, 2015

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment