bigdataviewer / bigdataviewer-core

ImgLib2-based viewer for registered SPIM stacks and more
BSD 2-Clause "Simplified" License
33 stars 35 forks source link

Potential deadlock with new version #108

Closed tischi closed 3 years ago

tischi commented 3 years ago

Hi @tpietzsch,

Since version 9.* we experience a deadlock in the following scenario:

Using BdvFunctions.show() we create a new BDV window and we add a source to it, which takes a long time to fully load because it comes from s3 storage.

Then the BdvFunction.show() call returns in debugging mode, however the source is still not shown but the BDV window is plain gray.

image

Then our code proceeds to changing the view using a SimilarityTransformAnimator and BDV hangs.

This can be resolved by calling the change of the view like this, i.e. giving some additional time and starting a new thread. I currently think both are necessary.

new Thread( () -> {
    Utils.wait( 2000 ); // without the waiting it hangs => TODO: make issue
    adaptViewerTransform( bookmark );
} ).start();

Honestly I am not 100 % sure yet whether this is an issue on my side, because I am also updating another swing window while all of this happens. However what speaks against this is that this did not happen with an older version 8.* of BDV and I do not think I changed my code since then at this place.

Do you have an idea whether this could be an issue in the new bigdataviewer-core?

tpietzsch commented 3 years ago

I have no idea... Does it happen also if you use a local source or is it tied to the s3? Can you point me to the code?

tpietzsch commented 3 years ago

and can you attach visualvm to see whether it is a deadlock and where the deadlock is?

tischi commented 3 years ago

There is a deadlock according to VisualVM. Does that help?

2020-09-15 22:55:37
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.161-b12 mixed mode):

"RMI TCP Connection(2)-192.168.2.103" #83 daemon prio=9 os_prio=31 tid=0x00007fcf4355e800 nid=0xfe13 runnable [0x000070000e05c000]
   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:171)
        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 <0x0000000775274e28> (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$0(TCPTransport.java:683)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$366/435187183.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:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

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

"JMX server connection timeout 82" #82 daemon prio=9 os_prio=31 tid=0x00007fcf458c2800 nid=0xe157 in Object.wait() [0x000070000df5a000]
   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 <0x0000000774c7d7a0> (a [I)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"RMI Scheduler(0)" #81 daemon prio=9 os_prio=31 tid=0x00007fcf427b5000 nid=0x1162f waiting on condition [0x000070000de57000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000774566e38> (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:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"RMI TCP Connection(1)-192.168.2.103" #80 daemon prio=9 os_prio=31 tid=0x00007fcf483e3000 nid=0xe33b runnable [0x000070000dbd0000]
   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:171)
        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 <0x0000000774bff1b8> (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$0(TCPTransport.java:683)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$366/435187183.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:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

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

"RMI TCP Accept-0" #79 daemon prio=9 os_prio=31 tid=0x00007fcf46a24800 nid=0xf9b7 runnable [0x000070000cda4000]
   java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
        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:748)

   Locked ownable synchronizers:
        - None

"SwingWorker-pool-1-thread-2" #74 daemon prio=5 os_prio=31 tid=0x00007fcf4266a000 nid=0xf8ab waiting on condition [0x000070000dace000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000795c80850> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"PainterThread" #65 daemon prio=6 os_prio=31 tid=0x00007fcf459a4000 nid=0x811b waiting for monitor entry [0x000070000d948000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at bdv.BehaviourTransformEventHandler3D.setTransform(BehaviourTransformEventHandler3D.java:177)
        - waiting to lock <0x000000076de4f3e8> (a net.imglib2.realtransform.AffineTransform3D)
        at bdv.BehaviourTransformEventHandler3D.setTransform(BehaviourTransformEventHandler3D.java:51)
        at bdv.viewer.ViewerPanel.paint(ViewerPanel.java:492)
        - locked <0x000000076de49408> (a bdv.viewer.ViewerPanel)
        at net.imglib2.ui.PainterThread.run(PainterThread.java:86)

   Locked ownable synchronizers:
        - None

"Fetcher-3" #64 daemon prio=6 os_prio=31 tid=0x00007fcf46e6e000 nid=0x10a07 waiting on condition [0x000070000d845000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000076de40320> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at net.imglib2.cache.queue.BlockingFetchQueues.take(BlockingFetchQueues.java:189)
        at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:152)

   Locked ownable synchronizers:
        - None

"Fetcher-2" #63 daemon prio=6 os_prio=31 tid=0x00007fcf469b3000 nid=0xf007 waiting on condition [0x000070000d336000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000076de40320> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at net.imglib2.cache.queue.BlockingFetchQueues.take(BlockingFetchQueues.java:189)
        at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:152)

   Locked ownable synchronizers:
        - None

"Fetcher-1" #62 daemon prio=6 os_prio=31 tid=0x00007fcf46d22000 nid=0x5c0b waiting on condition [0x000070000d233000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000076de40320> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at net.imglib2.cache.queue.BlockingFetchQueues.take(BlockingFetchQueues.java:189)
        at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:152)

   Locked ownable synchronizers:
        - None

"Fetcher-0" #61 daemon prio=6 os_prio=31 tid=0x00007fcf4687b000 nid=0x4c0b waiting on condition [0x000070000b653000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000076de40320> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at net.imglib2.cache.queue.BlockingFetchQueues.take(BlockingFetchQueues.java:189)
        at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:152)

   Locked ownable synchronizers:
        - None

"DestroyJavaVM" #53 prio=5 os_prio=31 tid=0x00007fcf42002800 nid=0x1903 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"SwingWorker-pool-1-thread-1" #48 daemon prio=5 os_prio=31 tid=0x00007fcf46b8d000 nid=0xf417 waiting on condition [0x000070000dd54000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000795c80850> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"Fetcher-3" #34 daemon prio=5 os_prio=31 tid=0x00007fcf43b99800 nid=0x7207 waiting on condition [0x000070000d742000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000796c67108> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at net.imglib2.cache.queue.BlockingFetchQueues.take(BlockingFetchQueues.java:189)
        at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:152)

   Locked ownable synchronizers:
        - None

"Fetcher-2" #33 daemon prio=5 os_prio=31 tid=0x00007fcf43200800 nid=0x910f waiting on condition [0x000070000d63f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000796c67108> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at net.imglib2.cache.queue.BlockingFetchQueues.take(BlockingFetchQueues.java:189)
        at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:152)

   Locked ownable synchronizers:
        - None

"Fetcher-1" #32 daemon prio=5 os_prio=31 tid=0x00007fcf43200000 nid=0xc07 waiting on condition [0x000070000d53c000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000796c67108> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at net.imglib2.cache.queue.BlockingFetchQueues.take(BlockingFetchQueues.java:189)
        at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:152)

   Locked ownable synchronizers:
        - None

"Fetcher-0" #31 daemon prio=5 os_prio=31 tid=0x00007fcf46ac9000 nid=0x1007 waiting on condition [0x000070000ca12000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000796c67108> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at net.imglib2.cache.queue.BlockingFetchQueues.take(BlockingFetchQueues.java:189)
        at net.imglib2.cache.queue.FetcherThreads$Fetcher.run(FetcherThreads.java:152)

   Locked ownable synchronizers:
        - None

"java-sdk-http-connection-reaper" #30 daemon prio=5 os_prio=31 tid=0x00007fcf46375000 nid=0xe523 waiting on condition [0x000070000d439000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at com.amazonaws.http.IdleConnectionReaper.run(IdleConnectionReaper.java:188)

   Locked ownable synchronizers:
        - None

"TimerQueue" #21 daemon prio=5 os_prio=31 tid=0x00007fcf48190000 nid=0xe00b waiting on condition [0x000070000d130000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000006c1947328> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.DelayQueue.take(DelayQueue.java:211)
        at javax.swing.TimerQueue.run(TimerQueue.java:174)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x00000006c19473b8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)

"Java2D Disposer" #18 daemon prio=10 os_prio=31 tid=0x00007fcf45762000 nid=0xd217 in Object.wait() [0x000070000cfaa000]
   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 <0x00000006c02fa680> (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:748)

   Locked ownable synchronizers:
        - None

"Java2D Queue Flusher" #17 daemon prio=10 os_prio=31 tid=0x00007fcf45754800 nid=0x12b13 in Object.wait() [0x000070000cea7000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
        - locked <0x00000006c0543af0> (a sun.java2d.opengl.OGLRenderQueue$QueueFlusher)

   Locked ownable synchronizers:
        - None

"AWT-EventQueue-0" #15 prio=6 os_prio=31 tid=0x00007fcf41f14000 nid=0xbc0b waiting for monitor entry [0x000070000cc9f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at bdv.viewer.ViewerPanel.transformChanged(ViewerPanel.java:559)
        - waiting to lock <0x000000076de49408> (a bdv.viewer.ViewerPanel)
        at bdv.viewer.ViewerPanel.transformChanged(ViewerPanel.java:103)
        at net.imglib2.ui.InteractiveDisplayCanvasComponent.transformChanged(InteractiveDisplayCanvasComponent.java:285)
        at bdv.BehaviourTransformEventHandler3D.notifyListener(BehaviourTransformEventHandler3D.java:228)
        at bdv.BehaviourTransformEventHandler3D.setCanvasSize(BehaviourTransformEventHandler3D.java:201)
        - locked <0x000000076de4f3e8> (a net.imglib2.realtransform.AffineTransform3D)
        at net.imglib2.ui.InteractiveDisplayCanvasComponent$1.componentResized(InteractiveDisplayCanvasComponent.java:112)
        at java.awt.AWTEventMulticaster.componentResized(AWTEventMulticaster.java:159)
        at java.awt.Component.processComponentEvent(Component.java:6359)
        at java.awt.Component.processEvent(Component.java:6313)
        at java.awt.Container.processEvent(Container.java:2237)
        at java.awt.Component.dispatchEventImpl(Component.java:4889)
        at java.awt.Container.dispatchEventImpl(Container.java:2295)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        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$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.awt.EventQueue$4.run(EventQueue.java:729)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        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-Shutdown" #14 prio=5 os_prio=31 tid=0x00007fcf41eb5000 nid=0x692b in Object.wait() [0x000070000c88c000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:502)
        at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:295)
        - locked <0x00000006c0544060> (a java.lang.Object)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"AppKit Thread" #13 daemon prio=5 os_prio=31 tid=0x00007fcf437e4000 nid=0x307 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Timer-0" #11 daemon prio=5 os_prio=31 tid=0x00007fcf42725000 nid=0x4203 in Object.wait() [0x000070000c789000]
   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.util.TimerThread.mainLoop(Timer.java:526)
        - locked <0x00000006c0561f40> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:505)

   Locked ownable synchronizers:
        - None

"Attach Listener" #10 daemon prio=9 os_prio=31 tid=0x00007fcf42c98000 nid=0x4403 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Service Thread" #9 daemon prio=9 os_prio=31 tid=0x00007fcf4250c000 nid=0x4703 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"C1 CompilerThread2" #8 daemon prio=9 os_prio=31 tid=0x00007fcf434b3800 nid=0x4803 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"C2 CompilerThread1" #7 daemon prio=9 os_prio=31 tid=0x00007fcf42509800 nid=0x3a03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"C2 CompilerThread0" #6 daemon prio=9 os_prio=31 tid=0x00007fcf42508800 nid=0x3803 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
        - None

"Monitor Ctrl-Break" #5 daemon prio=5 os_prio=31 tid=0x00007fcf42507000 nid=0x3603 runnable [0x000070000c074000]
   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:171)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
        - locked <0x00000006c0159480> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read(InputStreamReader.java:184)
        at java.io.BufferedReader.fill(BufferedReader.java:161)
        at java.io.BufferedReader.readLine(BufferedReader.java:324)
        - locked <0x00000006c0159480> (a java.io.InputStreamReader)
        at java.io.BufferedReader.readLine(BufferedReader.java:389)
        at com.intellij.rt.execution.application.AppMainV2$1.run(AppMainV2.java:64)

   Locked ownable synchronizers:
        - None

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

   Locked ownable synchronizers:
        - None

"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fcf41808000 nid=0x4f03 in Object.wait() [0x000070000be6e000]
   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 <0x00000006c076bc30> (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=31 tid=0x00007fcf4300d000 nid=0x5103 in Object.wait() [0x000070000bd6b000]
   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.tryHandlePending(Reference.java:191)
        - locked <0x00000006c0168968> (a java.lang.ref.Reference$Lock)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

   Locked ownable synchronizers:
        - None

"VM Thread" os_prio=31 tid=0x00007fcf42023000 nid=0x2d03 runnable 

"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fcf42808800 nid=0x2107 runnable 

"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fcf42809000 nid=0x2203 runnable 

"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fcf4200b800 nid=0x5403 runnable 

"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fcf4200c000 nid=0x2b03 runnable 

"VM Periodic Task Thread" os_prio=31 tid=0x00007fcf4250d000 nid=0x3c03 waiting on condition 

JNI global references: 3091

Found one Java-level deadlock:
=============================
"PainterThread":
  waiting to lock monitor 0x00007fcf46a84348 (object 0x000000076de4f3e8, a net.imglib2.realtransform.AffineTransform3D),
  which is held by "AWT-EventQueue-0"
"AWT-EventQueue-0":
  waiting to lock monitor 0x00007fcf4281cc58 (object 0x000000076de49408, a bdv.viewer.ViewerPanel),
  which is held by "PainterThread"

Java stack information for the threads listed above:
===================================================
"PainterThread":
        at bdv.BehaviourTransformEventHandler3D.setTransform(BehaviourTransformEventHandler3D.java:177)
        - waiting to lock <0x000000076de4f3e8> (a net.imglib2.realtransform.AffineTransform3D)
        at bdv.BehaviourTransformEventHandler3D.setTransform(BehaviourTransformEventHandler3D.java:51)
        at bdv.viewer.ViewerPanel.paint(ViewerPanel.java:492)
        - locked <0x000000076de49408> (a bdv.viewer.ViewerPanel)
        at net.imglib2.ui.PainterThread.run(PainterThread.java:86)
"AWT-EventQueue-0":
        at bdv.viewer.ViewerPanel.transformChanged(ViewerPanel.java:559)
        - waiting to lock <0x000000076de49408> (a bdv.viewer.ViewerPanel)
        at bdv.viewer.ViewerPanel.transformChanged(ViewerPanel.java:103)
        at net.imglib2.ui.InteractiveDisplayCanvasComponent.transformChanged(InteractiveDisplayCanvasComponent.java:285)
        at bdv.BehaviourTransformEventHandler3D.notifyListener(BehaviourTransformEventHandler3D.java:228)
        at bdv.BehaviourTransformEventHandler3D.setCanvasSize(BehaviourTransformEventHandler3D.java:201)
        - locked <0x000000076de4f3e8> (a net.imglib2.realtransform.AffineTransform3D)
        at net.imglib2.ui.InteractiveDisplayCanvasComponent$1.componentResized(InteractiveDisplayCanvasComponent.java:112)
        at java.awt.AWTEventMulticaster.componentResized(AWTEventMulticaster.java:159)
        at java.awt.Component.processComponentEvent(Component.java:6359)
        at java.awt.Component.processEvent(Component.java:6313)
        at java.awt.Container.processEvent(Container.java:2237)
        at java.awt.Component.dispatchEventImpl(Component.java:4889)
        at java.awt.Container.dispatchEventImpl(Container.java:2295)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        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$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.awt.EventQueue$4.run(EventQueue.java:729)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        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)

Found 1 deadlock.
tpietzsch commented 3 years ago

thanks, that helps a lot! I'll investigate...

tpietzsch commented 3 years ago

Ok, that deadlock should be actually fixed in the 10.* releases. It is the same deadlock (or related to) #106

tischi commented 3 years ago

ok! thanks!

  1. do you think I would break anyones update site (e.g., Nico, Preibisch) by shipping a 10.* release into Fiji?
  2. (a bit unrelated, I hope) at which point in time do you plan to remove the deprecated functions? I still did not find the time to adapt my code to not using them...
tpietzsch commented 3 years ago
  • do you think I would break anyones update site (e.g., Nico, Preibisch) by shipping a 10.* release into Fiji?

Yes, you would, unfortunately.

  • (a bit unrelated, I hope) at which point in time do you plan to remove the deprecated functions? I still did not find the time to adapt my code to not using them...

I was thinking of starting to remove some in 10.0.0 already. Good that I didn't... :-)