Skip to content
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

ImageJ hangs when displaying two Img input widgets #278

Open
imagejan opened this issue Jul 17, 2017 · 2 comments
Open

ImageJ hangs when displaying two Img input widgets #278

imagejan opened this issue Jul 17, 2017 · 2 comments

Comments

@imagejan
Copy link
Member

To reproduce:

  • Start ImageJ (e.g. up-to-date Fiji, with scijava-common-2.64.0)
  • Open two images (e.g. the Blobs sample image twice: Shift+B, Shift+B)
  • Open the script editor ([)
  • Paste and run the following Groovy script:
    #@ Img in1
    #@ Img in2
    
    println 42
  • For the second input, try to switch to the second image.

ImageJ will get unresponsive and hang in a loop at high CPU load. This is an excerpt from the stack trace recorded on Windows 7:

"SciJava-738d4226-Thread-4786" #4831 prio=6 os_prio=0 tid=0x0000001970bb5800 nid
=0x24b4c in Object.wait() [0x0000001a769ff000]
   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.awt.EventQueue.invokeAndWait(EventQueue.java:1315)
        - locked <0x00000000909bdb18> (a java.awt.EventQueue$1AWTInvocationLock)

        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1296)
        at org.scijava.thread.DefaultThreadService.invoke(DefaultThreadService.java:117)
        at org.scijava.ui.AbstractUIInputWidget.refreshWidget(AbstractUIInputWidget.java:82)
        at org.scijava.widget.AbstractInputPanel.refresh(AbstractInputPanel.java:89)
        at org.scijava.widget.DefaultWidgetModel$1.run(DefaultWidgetModel.java:177)
        at org.scijava.thread.DefaultThreadService$2.run(DefaultThreadService.java:220)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        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:748)

"SciJava-738d4226-Thread-4785" #4830 prio=6 os_prio=0 tid=0x0000001970bb5000 nid
=0x6c04 in Object.wait() [0x0000001a767ff000]
   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.awt.EventQueue.invokeAndWait(EventQueue.java:1315)
        - locked <0x0000000091d2e3f8> (a java.awt.EventQueue$1AWTInvocationLock)

        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1296)
        at org.scijava.thread.DefaultThreadService.invoke(DefaultThreadService.java:117)
        at org.scijava.ui.AbstractUIInputWidget.refreshWidget(AbstractUIInputWidget.java:82)
        at org.scijava.widget.AbstractInputPanel.refresh(AbstractInputPanel.java:89)
        at org.scijava.widget.DefaultWidgetModel$1.run(DefaultWidgetModel.java:177)
        at org.scijava.thread.DefaultThreadService$2.run(DefaultThreadService.java:220)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        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:748)

"SciJava-738d4226-Thread-4784" #4829 prio=6 os_prio=0 tid=0x0000001970bb4000 nid
=0x243f4 in Object.wait() [0x0000001a765ff000]
   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.awt.EventQueue.invokeAndWait(EventQueue.java:1315)
        - locked <0x000000008e1e22a0> (a java.awt.EventQueue$1AWTInvocationLock)

        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1296)
        at org.scijava.thread.DefaultThreadService.invoke(DefaultThreadService.java:117)
        at org.scijava.ui.AbstractUIInputWidget.refreshWidget(AbstractUIInputWidget.java:82)
        at org.scijava.widget.AbstractInputPanel.refresh(AbstractInputPanel.java:89)
        at org.scijava.widget.DefaultWidgetModel$1.run(DefaultWidgetModel.java:177)
        at org.scijava.thread.DefaultThreadService$2.run(DefaultThreadService.java:220)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        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:748)

"SciJava-738d4226-Thread-4783" #4828 prio=6 os_prio=0 tid=0x0000001970bb3800 nid
=0x212dc in Object.wait() [0x0000001a763ff000]
   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.awt.EventQueue.invokeAndWait(EventQueue.java:1315)
        - locked <0x000000008e3ac4d8> (a java.awt.EventQueue$1AWTInvocationLock)

        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1296)
        at org.scijava.thread.DefaultThreadService.invoke(DefaultThreadService.java:117)
        at org.scijava.ui.AbstractUIInputWidget.refreshWidget(AbstractUIInputWidget.java:82)
        at org.scijava.widget.AbstractInputPanel.refresh(AbstractInputPanel.java:89)
        at org.scijava.widget.DefaultWidgetModel$1.run(DefaultWidgetModel.java:177)
        at org.scijava.thread.DefaultThreadService$2.run(DefaultThreadService.java:220)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        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:748)

"SciJava-738d4226-Thread-4782" #4827 prio=6 os_prio=0 tid=0x0000001970bb2800 nid
=0x25c24
@ctrueden
Copy link
Member

ctrueden commented Jul 17, 2017

Was able to reproduce on macOS. Traced the introduction of the ThreadService::invoke call to imagej/ImageJ@00d7cc1. Will need to dig in further to decide on the best course of action to fix.

@imagejan
Copy link
Member Author

imagejan commented Jan 4, 2018

This came up again in a discussion on the forum related to imagej/imagej-legacy#166.

As it is in fact an issue in either imagej/imagej or imagej/imagej-legacy, we should probably close here and continue discussion in a more appropriate place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants