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

Second ImageWriter.setOutput() crashes VM

XMLWordPrintable

    • hopper
    • generic
    • generic
    • Verified



      Name: agR10195 Date: 03/29/2002



      Alexey Gibadullin, ###@###.###

      The following test crashes Server and Client VMs (build 1.4.1-beta-b06)
      in all modes and on all platforms.

      The test prepares ImageWriter and ImageOutputStream objects,
      then sets output of the ImageWriter, disposes that writer and
      then sets output again. Invokation of the second writer.setOutput()
      crashes the VM.

      The test also crashes VM without writer.dispose() command.

      import java.io.*;
      import java.util.*;
      import javax.imageio.*;
      import javax.imageio.stream.*;

      public class Test {
          public static void main(String args[]) {

              // Retrieve ImageWriter
              Iterator writers = ImageIO.getImageWritersByFormatName("jpeg");
              ImageWriter writer = (ImageWriter) writers.next();

              // Retrieve ImageOutputStream
              ImageOutputStream ios;
              try {
                  ios = ImageIO.createImageOutputStream(new File("OutputFile.jpg"));
              } catch(IOException e) {
                  System.out.println("Unexpected exception.");
                  e.printStackTrace(System.out);
                  return;
              }
              System.out.println("ios = " + ios);
              if (ios == null)
                  return;

              // Set ImageOutputStream to ImageWriter
              writer.setOutput(ios);
              System.out.println("1: output is set.");
              writer.dispose();
              System.out.println("writer is not disposed.");
              writer.setOutput(ios);
              System.out.println("2: output is set.");
          }
      }

      % ../jdk1.4.1-b06/solsparc/bin/java -version
      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b06)
      Java HotSpot(TM) Client VM (build 1.4.1-beta-b06, mixed mode)

      % ../jdk1.4.1-b06/solsparc/bin/java Test
      /export/ld25/java/dest/jdk1.4.1-b06/solsparc/bin/java Test
      ios = javax.imageio.stream.FileImageOutputStream@1e0bc08
      1: output is set.
      writer is disposed.

      An unexpected exception has been detected in native code outside the VM.
      Unexpected Signal : 11 occurred at PC=0xFDEBF940
      Function=Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_setDest+0x4
      Library=/export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/libjpeg.so

      Current Java thread:
              at com.sun.imageio.plugins.jpeg.JPEGImageWriter.setDest(Native Method)
              at com.sun.imageio.plugins.jpeg.JPEGImageWriter.setOutput(JPEGImageWriter.java:167)
              at Test.main(Test.java:25)

      Dynamic libraries:
      0x10000 /export/ld25/java/dest/jdk1.4.1-b06/solsparc/bin/java
      0xff350000 /usr/lib/libthread.so.1
      0xff390000 /usr/lib/libdl.so.1
      0xff200000 /usr/lib/libc.so.1
      0xff330000 /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
      0xfe000000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/client/libjvm.so
      0xff2d0000 /usr/lib/libCrun.so.1
      0xff1d0000 /usr/lib/libsocket.so.1
      0xff100000 /usr/lib/libnsl.so.1
      0xff0d0000 /usr/lib/libm.so.1
      0xff300000 /usr/lib/libw.so.1
      0xff0b0000 /usr/lib/libmp.so.2
      0xff070000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/native_threads/libhpi.so
      0xff040000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/libverify.so
      0xfe7c0000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/libjava.so
      0xff020000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/libzip.so
      0xfe690000 /usr/lib/locale/ru_RU.KOI8-R/ru_RU.KOI8-R.so.2
      0xfdfb0000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/libcmm.so
      0xfdeb0000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/libjpeg.so
      0xf1c00000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/libawt.so
      0xfc480000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/libmlib_image.so
      0xfc790000 /export/ld55/java/dest/jdk1.4.1-b06/solsparc/jre/lib/sparc/motif21/libmawt.so
      0xf1980000 /usr/lib/libXm.so.4
      0xfc410000 /usr/openwin/lib/libXt.so.4
      0xfa3d0000 /usr/openwin/lib/libXext.so.0
      0xfdf90000 /usr/openwin/lib/libXtst.so.1
      0xf1880000 /usr/openwin/lib/libX11.so.4
      0xfa2a0000 /usr/openwin/lib/libdps.so.5
      0xfa3b0000 /usr/openwin/lib/libSM.so.6
      0xfa1d0000 /usr/openwin/lib/libICE.so.6
      0xfa1a0000 /usr/openwin/lib/libdga.so.1

      Local Time = Fri Mar 29 17:06:26 2002
      Elapsed Time = 4
      #
      # The exception above was detected in native code outside the VM
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.1-beta-b06 mixed mode)
      #
      # An error report file has been saved as hs_err_pid7941.log.
      # Please refer to the file for further information.
      #
      Abort

      I borrowed the source code (and modified it a bit) from the bug

          4501529 JAVA VM crashes uses Java Advanced Imaging

      that is closed as duplicate of
          
          4520884 ImageI/O JPEG encoder causes VM crash on Win32

      ======================================================================

      Name: agR10195 Date: 05/07/2002



      Alexey Gibadullin, ###@###.###

      I have added this testcase into testbase_nsk, so that it
      could be executed regularly by the SQE team. The test will
      be shipped with 14 release of testbase_nsk; and the test
      name will be:

          nsk/regression/b4660047
          
      The test still reproduces the bug against Hopper-b10 on all
      platforms.


      ======================================================================

            campbell Christopher Campbell (Inactive)
            gazsunw Gaz Gaz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: