Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4874501

VM crashes when writer.dispose() is called within imageProgress() method

    Details

    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, windows_xp

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bae Andrew Brygin
                Reporter:
                pmohansunw Praveen Mohan (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: