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.

Bug 906 - java################### left in /tmp (Suse Linux 13.1)
java################### left in /tmp (Suse Linux 13.1)
Status: NEEDSINFO
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Linux
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2014-08-18 04:53 CDT by Aryeh Weiss
Modified: 2015-02-12 06:37 CST
5 users (show)

See Also:


Attachments
full text of exception (70.99 KB, text/plain)
2014-08-18 05:10 CDT, Aryeh Weiss
macro which I was running (14.21 KB, text/plain)
2014-08-18 05:12 CDT, Aryeh Weiss
Minimal example for error reproduction. Contains deconv.ijm macro and an image directory. (89 bytes, text/plain)
2015-02-03 05:46 CST, mone7979
Minimal example for error reproduction. Contains deconv.ijm macro and an image directory. (1.05 MB, application/zip)
2015-02-11 15:04 CST, mone7979

Description Aryeh Weiss 2014-08-18 04:53:43 CDT
After runing Fiji, directories of the form /tmp/java########## are left.
(For example: java6906629474009672505/ )
These directories appear to be related to plugins called form one of my scripts.
They do not go away when I exit Fiji,and if I run the same script after exiting and restarting Fiji,
I will see a second set of such directories (with different numbers).

This apparently filled my /tmp directory, causing Fiji to fail to start. After I removed them, Fij i functioned properly. 

Is this a bug in Fiji, in Java, or due to a  mistake on my part?

Information about your version of Java:

  os.arch => amd64
  os.name => Linux
  os.version => 3.11.10-11-desktop
  java.version => 1.6.0_24
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_24-b07
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 19.1-b02
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.X11GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => null
  file.separator => /

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: /home/victoria/Desktop/Fiji.app/java/linux-amd64/jdk1.6.0_24//jre
  imagej.dir => /home/victoria/Desktop/Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20140814190445)
Fiji: http://fiji.sc/update/ (last check:20140813215223)
3D ImageJ Suite: http://sites.imagej.net/Tboudier/ (last check:20140604090506)
BioVoxxel: http://sites.imagej.net/BioVoxxel/ (last check:20140811153030)
Cookbook: http://sites.imagej.net/Cookbook/ (last check:20131221011857)
CMCI-EMBL: http://sites.imagej.net/Miura/ (last check:20140718170940)
Morphology: http://sites.imagej.net/Landini/ (last check:20140723175558)
ScientiFig: http://sites.imagej.net/Aigouy/ (last check:20140812182844)

Files not up-to-date:
  2e7b86b4 (MODIFIED) 20140818122636 jars/ij-1.49b.jar
  5bff40de (LOCAL_ONLY) 20140629110456 plugins/Utilities/Grid_.class
  00501934 (LOCAL_ONLY) 20120410223928 plugins/ij-plugins_toolkit.jar
Comment 1 Aryeh Weiss 2014-08-18 05:10:55 CDT
Created attachment 201
full text of exception
Comment 2 Aryeh Weiss 2014-08-18 05:12:56 CDT
Created attachment 202
macro which I was running
Comment 3 Aryeh Weiss 2014-08-18 05:16:06 CDT
Additional note: every time I run the script, a new set of such directories is created. Each appears to contain a plugin which I am using in the script.
Each time I run the script, three such directories are created.

We just noticed also the when this script starts, we get the following exception:

(Fiji Is Just) ImageJ 2.0.0-rc-13/1.49f7; Java 1.6.0_24 [64-bit]; Linux 3.11.10-11-desktop; 119MB of 4625MB (2%)
 
java.lang.StackOverflowError
	at net.imagej.legacy.LegacyOutputTracker.getTracker(LegacyOutputTracker.java:166)
	at net.imagej.legacy.LegacyOutputTracker.removeOutput(LegacyOutputTracker.java:99)
	at net.imagej.legacy.DefaultLegacyHooks.unregisterImage(DefaultLegacyHooks.java:187)
	at ij.gui.ImageWindow.close(ImageWindow.java)
	at ij.gui.StackWindow.close(StackWindow.java:182)
	at ...

I attached the full exception text and the macro. I note that after receiving the exception, the macro appears to function correctly.
Comment 4 Aryeh Weiss 2014-08-18 05:22:32 CDT
More information:

This error occurs when I do:

run("Close All");

this also happen when I run it from the menu.
Comment 5 Aryeh Weiss 2014-08-18 05:27:07 CDT
Something else (sorry , I did not expect it).

When I try to manually close the images, most of them close , but two of them 
fail, and generate the exception:

(Fiji Is Just) ImageJ 2.0.0-rc-13/1.49f7; Java 1.6.0_24 [64-bit]; Linux 3.11.10-11-desktop; 89MB of 4625MB (1%)
 
java.lang.StackOverflowError
	at net.imagej.legacy.Utils.findLegacyThreadGroup(Utils.java:56)
	at net.imagej.legacy.LegacyOutputTracker.getTracker(LegacyOutputTracker.java:166)
	at net.imagej.legacy.LegacyOutputTracker.removeOutput(LegacyOutputTracker.java:99)
	at net.imagej.legacy.DefaultLegacyHooks.unregisterImage(DefaultLegacyHooks.java:187)
	at ij.gui.ImageWindow.close(ImageWindow.java)
	at ij.gui.StackWindow.close(StackWindow.java:182)

etc.
Comment 6 Curtis Rueden 2014-08-18 16:21:27 CDT
The StackOverflowError messages are a symptom of a different bug, which I fixed yesterday:
https://github.com/imagej/imagej-legacy/commit/2729b90ed8b1e0ab349172f6b0d641c8d3572a9e

That fix is being released and uploaded as I write this. But I will leave this issue open since it is primarily about the proliferation of temporary directories.
Comment 7 Aryeh Weiss 2014-08-18 21:44:45 CDT
Thank you. 
Why did it only fail for some images, and not for most of them?
Comment 8 Curtis Rueden 2014-08-19 08:32:06 CDT
I did not duplicate the exact circumstance you had with the StackOverflowError (I saw the error in a slightly different situation, after some code changes locally). So I cannot be certain why it only happens for some images. But if I had to speculate, I'd say maybe a race condition (multiple threads modifying data structures at the same time).

In any case, please let me know if you still see StackOverflowErrors after updating, while the "Enable ImageJ2 data structures" option is OFF (which it is by default now).
Comment 9 Johannes Schindelin 2014-08-19 12:14:25 CDT
I fear that this code is not called: https://github.com/scijava/scripting-java/blob/1c965a106eed858523d0e8c0ec663fab4caaa628/src/main/java/org/scijava/plugins/scripting/java/JavaEngine.java#L329-L342 (it is supposed to clean up the temporary directory after use)
Comment 10 Aryeh Weiss 2014-08-20 21:39:26 CDT
I did not see that stack overflow error following the most recent update.
I cannot be sure that this problem is solved, because in the past it only occurred with some images. However, I tried to reproduce the previous workflow, and did not reproduce the error. So it looks like this part is solved.
Comment 11 mone7979 2015-01-31 10:32:31 CST
Hi everyone,

I encounter the exact same problem as Aryeh.

I just got the latest stable release of Fiji 2 days ago, and also updated again when the problem started.

I am running Fiji on a Windows 7 64-bit system. 
SCIFIO is by default turned off (I checked).

My macro is extremely simple, I just use the Color Deconvolution Plugin repeatedly for some 600 microscopy images (quite large, about 3000x4000).

// some directories are retrieved before
for(i = 0; i < list.length; i++) 
{
	input = dir1+list[i];
	print(input);

	run("Open [Image IO]", "image=["+input+"]");
	run("Colour Deconvolution", "vectors=[Embryo Anatomie II] hide");
		
	if(isOpen(4))
	{
		selectImage(4);
		run("RGB Color");
		saveAs("Tiff", dir2 + list[i]);
	}
			
	run("Close All");
}

What happens is the following:
for every image a directory named java########## (##### being some large number, as it was with Aryeh) is created in my temp directory, contents are further directories src, target, and a file (the culprit) pom.xml.
pom.xml starts with about 66kB, but DOUBLES for each image, reaching about 68 MB after 12 images. The execution time increases significantly, so that I have to process the images in chunks of about 10 images.
So apparently pom.xml is somehow internally reset after the macro finished (that's how I imagine it).

So it seems to me the problem was not yet solved. Or do you have any ideas? Thanks in advance.
Comment 12 Mark Hiner 2015-02-02 09:21:48 CST
mone7979 - I was unable to reproduce this on my windows machine with the latest Fiji.

I tried running macros and the individual commands, with and without SCIFIO, and the only temporary file I saw pop up was a mapdb file (which SCIFIO does use) that was deleted appropriately when Fiji quit.

>I just got the latest stable release

Can you clarify which download you used? Was it the "Fiji continuous release"? If not I would recommend trying that, or running Help > Update Fiji.

If you're still seeing this problem with the latest Fiji, would you mind creating a minimal script (i.e. one that can be run anywhere without requiring modification - by using the sample images, for example) that causes this problem on your system?

Thank you!
- Mark

P.S. In addition to an up-to-date Fiji, let us know if you have any extra update sites or plugins installed. This info is reported in the Help > Report a Bug dialog from Fiji.
Comment 13 mone7979 2015-02-03 05:46:24 CST
Created attachment 229
Minimal example for error reproduction. Contains deconv.ijm macro and an image directory.
Comment 14 mone7979 2015-02-03 05:48:44 CST
Hi,

I forgot to mention that I used the .java/.class versions downloaded from the project website, as I had to add my own color vectors to the menu. Maybe that's the crucial part?

Anyhow, I again downloaded the Fiji Win32 continuous release version today, and put the .java/.class files from the colour deconvolution project website to the plugin directory.

For reproducing the error it is sufficient to just use the deconvolution with any of the color vectors, the test case is attatched. It contains the deconv.ijm macro, and a directory with 15 images. 

When running the macro, processing time starts to noticeably increase after about 10 images. Again, for every image a directory called javaXXXXXXX is created in my Temp directory, with increasing file size of pom.xml.

Hope you can reproduce the error now.

Thanks and have a nice day,
Simone
Comment 15 Curtis Rueden 2015-02-06 05:57:25 CST
Thanks mone7979. Unfortunately, it looks like the attachment you uploaded is somehow only a text file containing the description, rather than the ZIP file as intended.

However, I had an idea for a possible fix, which I would like you to test.

Please download this file:
  http://curtis.imagej.net/fiji-bug-906/scripting-java-0.2.6-SNAPSHOT.jar

Place it in your Fiji.app/jars directory, and delete the old scripting-java-0.2.5.jar.

Then start Fiji, try to reproduce the problem again using your workflow, and let us know how it goes.

If this change fixes the problem for you, we will release it to the ImageJ update site.

P.S. In case you're curious, the relevant code change (as pointed out by Johannes a while ago in this thread) is:

  https://github.com/scijava/scripting-java/compare/fix-tmp-proliferation
Comment 16 mone7979 2015-02-11 15:04:33 CST
Created attachment 234
Minimal example for error reproduction. Contains deconv.ijm macro and an image directory.
Comment 17 Curtis Rueden 2015-02-11 15:17:16 CST
@mone7979 Does the problem still occur with my updated scripting-java snapshot JAR?
Comment 18 mone7979 2015-02-11 15:19:22 CST
Hi,

sorry for the late answer, and thanks for you taking care of my problem. I followed your instructions, but unfortunately it still shows the same behavior.

I attatched the .zip file containing the minimal example, this time apparently correctly...

Hopefully you can reproduce the error. Otherwise I have no clue what to do. 

Regarding my task, I just applied the script like 60 times in chunks of about 10 images to do the color deconvolution of the whole data set. Probably I will not need this functionality any more. But still, apparently this error happens also for other people, so maybe my example can help to find the problem?

Another idea, did you try to reproduce the error with the colour-deconvolution .jar that comes when fiji is downloaded? Maybe it's something that only happens with the download-version of the project webpage, which I had to use since I had to adapt something in the source code.

Bye,
Simone
Comment 19 Curtis Rueden 2015-02-11 15:26:20 CST
Thanks for the quick follow-up.

> did you try to reproduce the error with the colour-deconvolution .jar
> that comes when fiji is downloaded? Maybe it's something that only
> happens with the download-version of the project webpage, which I had
> to use since I had to adapt something in the source code.

That theory makes sense. I did not test with the downloaded version. And I could not reproduce the issue with your example macro + files on my OS X system.

It would be very helpful if you could verify whether the problem still occurs on your system with the stock Colour Deconvolution JAR, rather than the modified version.

Alternately, you can use the File > Make Fiji Package command to zip up your installation, and then upload that somewhere (e.g., Dropbox), which will increase our chances of being able to reproduce.
Comment 20 mone7979 2015-02-12 06:37:50 CST
So, my theory was correct, the error does not appear when I use the included version, only with the .class/.java version. 

I can for sure say that the problem was not caused by the modifications I made, since I just added an additional staining in the code, just another set of vectors. 

Probably fixing the error is then more a task for the original developers of the project?

Anyhow, thank you very much for your help. If you think some more input from me is necessary, I am happy to provide it.

Simone