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

JAVA VM crashes uses Java Advanced Imaging

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs



      Name: ddT132432 Date: 09/10/2001


      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

      Run this using jdk1.4.0beta2.
       
      All it does is read in a JPEG and write it back out as a seperate file.
      This is looped 100 times.

      NOTE THE COMMENTS AT THE "for" loop.


      ---------------- ERROR LOG FILE START------------------------------------

      An unexpected exception has been detected in native code outside the VM.
      Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D2B248B
      Function=[Unknown.]
      Library=(N/A)

      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.ja
      va:829)
              - locked <06A79A08> (a java.lang.Class)
              at javax.imageio.ImageWriter.write(ImageWriter.java:598)
              at ImageTest.main(ImageTest.java:46)

      Dynamic libraries:
      0x7D2A0000 - 0x7D2CD000 C:\WINDOWS\SYSTEM\DBGHELP.DLL

      Local Time = Thu Sep 06 17:57:54 2001
      Elapsed Time = 7
      #
      # The exception above was detected in native code outside the VM
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.0-beta-b65 mixed mode)
      #

      ---------------- ERROR LOG FILE END ------------------------------------
      */

      import java.awt.*;
      import java.awt.event.*;
      import java.awt.image.*;
      import java.awt.image.renderable.*;
      import java.io.*;
      import javax.swing.*;
      import javax.media.jai.*;
      import javax.media.jai.widget.*;
      import com.sun.media.jai.codec.*;
      import java.util.*;
      import javax.imageio.*;
      import javax.imageio.stream.*;
      import javax.imageio.event.*;

      public class ImageTest
      {

      public static void main ( String[] _args )
      {
      String imagefile = _args [ 0 ];

      try {


      JPanel panel = new JPanel ();
      File file = new File ( imagefile );
      BufferedImage bi = ImageIO.read ( file );
      Image image = ( Image ) bi;
      for ( int i=0; i < 100; i++ )
      {
      File image_file = new File ( i+"_temp.jpg" );
      System.out.println ( "image: " + i );
      Iterator writers = ImageIO.getImageWritersByFormatName("jpeg");
      ImageWriter writer = (ImageWriter)writers.next();
      ImageOutputStream ios = ImageIO.createImageOutputStream( image_file );
      writer.setOutput(ios);
      int width = image.getWidth ( panel );
      int height = image.getHeight ( panel );
      System.out.println ( " width : " + width + " height "+ height );
      BufferedImage bbi = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);
      Graphics2D biContext = bbi.createGraphics();
      biContext.drawImage( image, 0, 0, null);
      writer.write(bbi);
      System.out.println ( i + " is done\n" );
      // if "dispose" is called there is a definite runtimeerror on i == 0;
      // if it isn't there is an error around i == 66
      //writer.dispose ();

      }

      }catch ( Exception _e )
      {
      }
      }
      }
      (Review ID: 131529)
      ======================================================================

            campbell Christopher Campbell (Inactive)
            ddressersunw Daniel Dresser (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: