JDK-6356926 : PIT: Regression test javax/imageio/stream/DeleteOnExit.sh is failing
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.imageio
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: generic
  • Submitted: 2005-11-30
  • Updated: 2008-02-05
  • Resolved: 2005-12-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6 b63Fixed
The regression test javax/imageio/stream/DeleteOnExit.sh has been failing in our
nightly runs as of 11/23/2005.  That date corresponds to the putback of:
6299405: ImageInputStreamImpl still uses a finalize() which causes

The test fails with this message:
Files before test: 21
iis = javax.imageio.stream.FileCacheImageInputStream@e102dc
ios = javax.imageio.stream.FileCacheImageOutputStream@efd552
Files after test: 23
Test fails: tmp file exists!
Exception in thread "Thread-0" java.util.ConcurrentModificationException
        at java.util.WeakHashMap$HashIterator.nextEntry(WeakHashMap.java:761)
        at java.util.WeakHashMap$KeyIterator.next(WeakHashMap.java:794)
        at com.sun.imageio.stream.StreamCloser$1.run(StreamCloser.java:47)
        at java.lang.Thread.run(Thread.java:626)
result: Failed. Execution failed: exit code 1

EVALUATION This was integrated into b63, but it wasn't marked as such until now.

EVALUATION This was caused by a silly mistake in my fix for 6299405. I cleaned up some code in StreamCloser so as to avoid an array copy. In theory the copy should be unnecessary because we synchronize add/remove operations on the toCloseQueue, or so I thought. It turns out that we don't actually synchronize properly in removeFromQueue(), but that's not really the cause of the failure here. The bug is that without the copied array, we will get a ConcurrentModificationException because is.close() will in turn call StreamCloser.removeFromQueue() while we are iterating over the set of streams. So anyway, I shouldn't have touched this code in the first place. I'll revert the code back to the way it was and will add a comment saying why the copy is necessary.