-
Bug
-
Resolution: Duplicate
-
P4
-
1.4.0, 5.0u6, 6, 7
-
generic, x86
-
generic, windows_xp
An image has been written to a file using a JPEG ImageWriter available in ImageIO. An IIOWriteProgressListener has been added to this JPEG writer to monitor the writing process. Inside the imageProgress() method of the listener I am calling writer.dispose() / writer.reset() when the percentageDone parameter is more than 50%. This makes the VM crash. It also happens when writer.setOutput() is called within the same method.
This is reproducible on Solaris as well as Windows right from JDK1.4.0+. Though the document says that calling any other method after dispose() would result in undefined behaviour I certainly do not expect the VM to crash. This undefined behavior has been documented for dispose() but not for reset(). This behavior is seen only with JPEG Image Writer and not reproducible with PNG writer.
I have attached a sample code. Execute the sample code on any JDK1.4+ build. You will notice the VM crash on the console. I have also attached the logfile that was created when VM crashed.
This is reproducible on Solaris as well as Windows right from JDK1.4.0+. Though the document says that calling any other method after dispose() would result in undefined behaviour I certainly do not expect the VM to crash. This undefined behavior has been documented for dispose() but not for reset(). This behavior is seen only with JPEG Image Writer and not reproducible with PNG writer.
I have attached a sample code. Execute the sample code on any JDK1.4+ build. You will notice the VM crash on the console. I have also attached the logfile that was created when VM crashed.
- relates to
-
JDK-4874601 Calling Reader.reset() inside the listener methods causes VM Crash
- Closed
-
JDK-5096514 Hotspot error log generated while running ImageIO test
- Closed
-
JDK-8003272 Bad performance when calling ImageReader.dispose(), ImageWriter.setOutput() with certain conditions
- Closed