|
Bugzilla – Bug 1013 |
Apparent deadlock freezes Fiji |
Last modified: 2015-03-02 12:00:53 CST |
| ⚠ |
NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug. The Fiji project now uses GitHub Issues for issue tracking. Please file all new issues there. |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|||||
In 2 of my dialog boxes I have a button which calls Close All IJ.runPlugIn("ij.plugin.Commands", "close-all"); I run ./ImageJ-linux64 in a terminal to see any possible error messages, but there are no errors. I also see the problem on a Mac, which is the first place it was reported. The program I use to demonstrate the problem is Run from CD from the Pet-Ct package. Any dialog which calls the above runPlugIn will do just as well. Read BI studies, which needs a database also shows the problem. To demonstrate the problem we need at least 2 cines running at a high frame rate. A frame rate of 1 will work, a frame rate of 10 will hang. What I do is bring up 2 series and run both of them in cine with a frame rate of 10. Then I press my button. The first cine will close, but the second won't. The cine will freeze, as will everything else in Fiji. The only way to solve the problem is to force quit Fiji. Since there are no error messages, it looks like a deadlock. There was a bug in ImageJ which I reported to Wayne Rasband and he fixed in the daily build, so you need to use the latest ImageJ to avoid the bug which Wayne fixed. An interesting point is that Close All in the File menu works OK. Likewise ImageJ works OK even with the button. Only Fiji hangs. I am guessing that there is a deadlock somewhere. Because of the high frame rate there are many events. The first cine gets closed and to continue some internal loop for the second cine, an event telling that the first cine has closed needs to arrive. That event is apparently lost so the system patiently waits forever. This is obviously a guess on my part. My Netbeans uses ImageJ for debugging and ImageJ works no matter what I do. I don't have the full source code for Fiji on my machine so it is difficult to pick up where the deadlock might be. This is without getting into the fact that I don't really know what is going on inside the system code. In short, it is over my head. I will be happy to help if I can do anything to help with this bug. IlanTry running Fiji from the command line and pressing control+"\" when it hangs. This will generate a full thread dump that may contain information helpful for diagnosing the cause of the thread deadlock. Also, try modifying your plugin so that it uses IJ.doCommand("Close All"), which runs "Close All" in s separate thread.Created attachment 238 thread dumpI had some difficulty getting the thread trace. Apparently my keyboard layout is somewhat different. Ctrl+"\" didn't do anything. I tried every key on the keyboard until Crtl+4 did the job. Wayne's idea of doCommand was very promising since it does the command on a different thread. I commented out the original and changed it to: private void jButClearActionPerformed(java.awt.event.ActionEvent evt) { // IJ.runPlugIn("ij.plugin.Commands", "close-all"); IJ.doCommand("Close All"); } This version doesn't hang and I will give it to Jerry so he can continue to work. If there is interest to find out why the first command fails, I will be glad to try and help. It is much less urgent with the work around. Thanks, Ilan