United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6356926 : PIT: Regression test javax/imageio/stream/DeleteOnExit.sh is failing

Details
Type:
Bug
Submit Date:
2005-11-30
Status:
Resolved
Updated Date:
2008-02-05
Project Name:
JDK
Resolved Date:
2005-12-15
Component:
client-libs
OS:
solaris_9
Sub-Component:
javax.imageio
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:

Related Reports

Sub Tasks

Description
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
         java.lang.OutOfMemoryError

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!
----------System.err:(5/319)----------
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

                                    

Comments
EVALUATION

This was integrated into b63, but it wasn't marked as such until now.
                                     
2005-12-15
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.
                                     
2005-11-30



Hardware and Software, Engineered to Work Together