<div dir="ltr">Hi all, I'm getting a deadly embrace that happens when the AWT event queue thread tries to get a lock within DefaultDatasetView.getColor and when DefaultStatusService.showStatus on a worker thread tries to publish a synchronous request for status display after taking the DefaultDatasetView's lock in DefaultDatasetView.rebuild. It happens periodically, but it's timing-dependent, so not so reproducible.<div>
<br></div><div>The bug is somewhat debatable. Possible candidates: It's a little drastic for DefaultDatasetView.getColor to synchronize on the view itself. Maybe some proxy for the color system could have a synchronizing object. The other candidate is DefaultEventService.showStatus which could use EventService.publishLater - I don't think there's much need for status publishers to wait around for the status to show on the screen.</div>
<div><div><br></div><div>The two stack traces:</div><div><div>Thread [AWT-EventQueue-0] (Suspended)<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>DefaultDatasetView.getColor(ChannelCollection) line: 261<span class="" style="white-space:pre">  <font color="#0000ff">Synchronized method on DefaultDatasetView</font></span></div>
<div><span class="" style="white-space:pre">    </span>FgColorTool(AbstractColorTool).drawIcon() line: 175<span class="" style="white-space:pre">       </span></div><div><span class="" style="white-space:pre">   </span>FgColorTool(AbstractColorTool).onEvent(DisplayActivatedEvent) line: 184<span class="" style="white-space:pre">   </span></div>
<div><span class="" style="white-space:pre">    </span>NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39<span class="" style="white-space:pre">        </span></div>
<div><span class="" style="white-space:pre">    </span>DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>Method.invoke(Object, Object...) line: 597<span class="" style="white-space:pre">        </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultEventService$ProxySubscriber<E>.onEvent(E) line: 282<span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventService$ProxySubscriber<E>.onEvent(Object) line: 1<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultEventBus(ThreadSafeEventService).publish(Object, String, Object, List, List, StackTraceElement[]) line: 971<span class="" style="white-space:pre">        </span></div><div>
<span class="" style="white-space:pre">       </span>DefaultEventBus.access$1(DefaultEventBus, Object, String, Object, List, List, StackTraceElement[]) line: 1<span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventBus$1.run() line: 201<span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultThreadService.invoke(Runnable) line: 91<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventBus.publishNow(Object, String, Object, List, List, StackTraceElement[]) line: 195<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultEventBus.publishNow(Object) line: 86<span class="" style="white-space:pre">       </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventService.publish(E) line: 95<span class="" style="white-space:pre">   </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultDisplayService.setActiveDisplay(Display<?>) line: 129<span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">   </span>DefaultDisplayService.onEvent(WinActivatedEvent) line: 247<span class="" style="white-space:pre">        </span></div>
<div><span class="" style="white-space:pre">    </span>NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39<span class="" style="white-space:pre">        </span></div>
<div><span class="" style="white-space:pre">    </span>DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>Method.invoke(Object, Object...) line: 597<span class="" style="white-space:pre">        </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultEventService$ProxySubscriber<E>.onEvent(E) line: 282<span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventService$ProxySubscriber<E>.onEvent(Object) line: 1<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultEventBus(ThreadSafeEventService).publish(Object, String, Object, List, List, StackTraceElement[]) line: 971<span class="" style="white-space:pre">        </span></div><div>
<span class="" style="white-space:pre">       </span>DefaultEventBus.access$1(DefaultEventBus, Object, String, Object, List, List, StackTraceElement[]) line: 1<span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventBus$1.run() line: 201<span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultThreadService.invoke(Runnable) line: 91<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventBus.publishNow(Object, String, Object, List, List, StackTraceElement[]) line: 195<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultEventBus.publishNow(Object) line: 86<span class="" style="white-space:pre">       </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventService.publish(E) line: 95<span class="" style="white-space:pre">   </span></div>
<div><span class="" style="white-space:pre">    </span>AWTWindowEventDispatcher.windowActivated(WindowEvent) line: 94<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>SwingDisplayWindow(Window).processWindowEvent(WindowEvent) line: 1877<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>SwingDisplayWindow(JFrame).processWindowEvent(WindowEvent) line: 274<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>SwingDisplayWindow(Window).processEvent(AWTEvent) line: 1823<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>SwingDisplayWindow(Component).dispatchEventImpl(AWTEvent) line: 4630<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>SwingDisplayWindow(Container).dispatchEventImpl(AWTEvent) line: 2099<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>SwingDisplayWindow(Window).dispatchEventImpl(AWTEvent) line: 2478<span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre">   </span>SwingDisplayWindow(Component).dispatchEvent(AWTEvent) line: 4460<span class="" style="white-space:pre">  </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultKeyboardFocusManager(KeyboardFocusManager).redispatchEvent(Component, AWTEvent) line: 1850<span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre">   </span>DefaultKeyboardFocusManager.typeAheadAssertions(Component, AWTEvent) line: 910<span class="" style="white-space:pre">    </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultKeyboardFocusManager.dispatchEvent(AWTEvent) line: 409<span class="" style="white-space:pre">     </span></div><div><span class="" style="white-space:pre">   </span>SwingDisplayWindow(Component).dispatchEventImpl(AWTEvent) line: 4502<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>SwingDisplayWindow(Container).dispatchEventImpl(AWTEvent) line: 2099<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>SwingDisplayWindow(Window).dispatchEventImpl(AWTEvent) line: 2478<span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre">    </span>SwingDisplayWindow(Component).dispatchEvent(AWTEvent) line: 4460<span class="" style="white-space:pre">  </span></div><div><span class="" style="white-space:pre">   </span>EventQueue.dispatchEvent(AWTEvent) line: 599<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent(SentEvent).dispatch() line: 55<span class="" style="white-space:pre">   </span></div><div><span class="" style="white-space:pre">   </span>DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch() line: 183<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultKeyboardFocusManager.sendMessage(Component, AWTEvent) line: 210<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">   </span>DefaultKeyboardFocusManager.dispatchEvent(AWTEvent) line: 286<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>SwingDisplayWindow(Component).dispatchEventImpl(AWTEvent) line: 4502<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>SwingDisplayWindow(Container).dispatchEventImpl(AWTEvent) line: 2099<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>SwingDisplayWindow(Window).dispatchEventImpl(AWTEvent) line: 2478<span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre">   </span>SwingDisplayWindow(Component).dispatchEvent(AWTEvent) line: 4460<span class="" style="white-space:pre">  </span></div>
<div><span class="" style="white-space:pre">    </span>EventQueue.dispatchEvent(AWTEvent) line: 599<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>SequencedEvent.dispatch() line: 101<span class="" style="white-space:pre">       </span></div>
<div><span class="" style="white-space:pre">    </span>EventQueue.dispatchEvent(AWTEvent) line: 597<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>EventDispatchThread.pumpOneEventForFilters(int) line: 269<span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre">    </span>EventDispatchThread.pumpEventsForFilter(int, Conditional, EventFilter) line: 184<span class="" style="white-space:pre">  </span></div><div><span class="" style="white-space:pre">   </span>EventDispatchThread.pumpEventsForHierarchy(int, Conditional, Component) line: 174<span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre">    </span>EventDispatchThread.pumpEvents(int, Conditional) line: 169<span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">   </span>EventDispatchThread.pumpEvents(Conditional) line: 161<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>EventDispatchThread.run() line: 122<span class="" style="white-space:pre">       </span></div></div><div><br></div><div><div>Thread [SciJava-4b2922f6-Thread-27] (Suspended)<span class="" style="white-space:pre">    </span></div>
<div><span class="" style="white-space:pre">    </span>Object.wait(long) line: not available [native method]<span class="" style="white-space:pre">     </span></div><div><span class="" style="white-space:pre">   </span>EventQueue$1AWTInvocationLock(Object).wait() line: 485<span class="" style="white-space:pre">    <font color="#0000ff">Waiting for AWT event thread to read invocation request.</font></span></div>
<div><span class="" style="white-space:pre">    </span>EventQueue.invokeAndWait(Runnable) line: 993<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>DefaultThreadService.invoke(Runnable) line: 95<span class="" style="white-space:pre">    </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultEventBus.publishNow(Object, String, Object, List, List, StackTraceElement[]) line: 195<span class="" style="white-space:pre">     </span></div><div><span class="" style="white-space:pre">   </span>DefaultEventBus.publishNow(Object) line: 86<span class="" style="white-space:pre">       </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultEventService.publish(E) line: 95<span class="" style="white-space:pre">   </span></div><div><span class="" style="white-space:pre">   </span>DefaultStatusService.showStatus(int, int, String) line: 77<span class="" style="white-space:pre">        </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultMinMaxMethod<T>.report() line: 296<span class="" style="white-space:pre">   </span></div><div><span class="" style="white-space:pre">   </span>DefaultMinMaxMethod<T>.process() line: 155<span class="" style="white-space:pre">  </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultAutoscaleMethod<T>.getRange(IterableInterval<T>) line: 70<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>DefaultAutoscaleService.getDefaultIntervalRange(IterableInterval<RealType<?>>) line: 97<span class="" style="white-space:pre">       </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultAutoscaleService.getDefaultRandomAccessRange(RandomAccessibleInterval<RealType<?>>) line: 105<span class="" style="white-space:pre">  </span></div><div>
<span class="" style="white-space:pre">       </span>DefaultDatasetView.autoscale(int) line: 176<span class="" style="white-space:pre">       </span></div><div><span class="" style="white-space:pre">   </span>DefaultDatasetView.initializeView(boolean) line: 499<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultDatasetView.rebuild() line: 383<span class="" style="white-space:pre">    <font color="#0000ff">Takes the DefaultDatasetView lock.</font></span></div><div><span class="" style="white-space:pre">      </span>DefaultImageDisplay.rebuild() line: 140<span class="" style="white-space:pre">   </span></div>
<div><span class="" style="white-space:pre">    </span>DefaultImageDisplay.display(Object) line: 273<span class="" style="white-space:pre">     </span></div><div><span class="" style="white-space:pre">   </span>DefaultOverlayService.addOverlays(ImageDisplay, List<Overlay>) line: 148<span class="" style="white-space:pre">    </span></div>
<div><span class="" style="white-space:pre">    </span>TurboRegRegister.run() line: 144<span class="" style="white-space:pre">  </span></div><div><span class="" style="white-space:pre">   </span>CommandModule.run() line: 196<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>ModuleRunner.run() line: 168<span class="" style="white-space:pre">      </span></div><div><span class="" style="white-space:pre">   </span>ModuleRunner.call() line: 129<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>ModuleRunner.call() line: 1<span class="" style="white-space:pre">       </span></div><div><span class="" style="white-space:pre">   </span>FutureTask$Sync.innerRun() line: 303<span class="" style="white-space:pre">      </span></div>
<div><span class="" style="white-space:pre">    </span>FutureTask<V>.run() line: 138<span class="" style="white-space:pre">       </span></div><div><span class="" style="white-space:pre">   </span>ThreadPoolExecutor$Worker.runTask(Runnable) line: 886<span class="" style="white-space:pre">     </span></div>
<div><span class="" style="white-space:pre">    </span>ThreadPoolExecutor$Worker.run() line: 908<span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre">   </span>Thread.run() line: 662<span class="" style="white-space:pre">    </span></div>
</div><div><br></div></div></div>