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

ImageI/O JPEG encoder causes VM crash on Win32

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      rc1
    • CPU:
      generic, x86
    • OS:
      windows_2000
    • Verification:
      Verified

      Description


      The JPEG encoder crashes on Win32.

      Attached is a sample testcase that works fine on any Solaris os,
      but crashes on Win98, NT and 2K. The testcase was tested on B84
      and B83.
      The problem doesn't seem to be there for PNG encoder.

      Steps to reproduce.

      1. Create a resources directory and save the Render2DTest.properties file
         to this folder. Compile Render2DTest.java file.
      2. Launch the applet 'appletviewer -Xnosecurity Render2DTest.html'
      3. You would find a frame with 4 radio buttons and 3 buttons.
      4. Select 'JPEG-Shape' radio button.
      5. Click on BuffImage, Write and Next buttons rapidly in succession, the
      application crashes in 3rd or 4th round. This is seen easily on Win2K.
      6. On Win 98 and NT, follow the above 3 steps. Keep on clicking the next
      button, till you see TYPE_BYTE_BINARY format.
      7. Click on BuffImage and then Write button, JVM crashes.

      Source File: Render2DTest.java
      HTML File: Render2DTest.html
      Resource File: Render2DTest.properties

      The stack trace on Win98 is as below. On Win2K, each time it crashes
      at different points.


      Creating a BufferedImage of type TYPE_BYTE_BINARY
      javax.imageio.IIOException: Metadata components != number of destination bands
              at com.sun.imageio.plugins.jpeg.JPEGImageWriter.checkSOFBands(JPEGImage
      riter.java:1139)
              at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.j
      va:588)
              at javax.imageio.ImageWriter.write(ImageWriter.java:575)
              at Render2DTest.actionPerformed(Render2DTest.java:478)
              at java.awt.Button.processActionEvent(Button.java:384)
              at java.awt.Button.processEvent(Button.java:353)
              at java.awt.Component.dispatchEventImpl(Component.java:3527)
              at java.awt.Component.dispatchEvent(Component.java:3368)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
      read.java:193)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
      ad.java:147)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
      ~

      Another testcase that verifies if the JPEG decoder used by Toolkit.getImage() can successfully read JPEG files created by using ImageIO with YCbCrA and RGBA colorspaces.

      Source File: JPEGAlphaTest.java

      Run 'java JPEGAlphaTest'

      The stack trace on Win98 is as below.

      An unexpected exception has been detected in native code outside the VM.
      Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D282529
      Function=Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage+0x818
      Library=C:\jdk14\jre\bin\jpeg.dll

      NOTE: We are unable to locate the function name symbol for the error
            just occurred. Please refer to release documentation for possible
            reason and solutions.


      Current Java thread:
              at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native
      Method)
              at
      com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:928)
              at javax.imageio.ImageWriter.write(ImageWriter.java:593)
              at javax.imageio.ImageIO.write(ImageIO.java:1367)
              at javax.imageio.ImageIO.write(ImageIO.java:1441)
              at JPEGAlphaTest.runTest(JPEGAlphaTest.java:38)
              at JPEGAlphaTest.main(JPEGAlphaTest.java:99)

      Dynamic libraries:
      0x7CC00000 - 0x7CC1D000 C:\WINDOWS\SYSTEM\IMAGEHLP.DLL

      Local Time = Mon Oct 29 14:18:09 2001
      Elapsed Time = 4
      #
      # The exception above was detected in native code outside the VM
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.0-beta3-b84 mixed mode)
      #

      ###@###.### 2001-11-19

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              campbell Christopher Campbell (Inactive)
              Reporter:
              kbalasubsunw Kannan Balasubramanian (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: