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

Access violation in awt.dll and OutOfMemoryException when setting -Xmx to 1024m

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 1.4.2, 7
    • client-libs
    • 2d
    • x86
    • windows_xp, windows_7

      FULL PRODUCT VERSION :
      java version "1.4.2_09"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Executing the code snippet below with VM argument -Xmx512m doesn't create any problem at all. However, when running with -Xmx1024m, the JVM dies with an EXCEPTION_ACCESS_VIOLATION (problematic frame: awt.dll) and an OutOfMemoryException.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Compile and execute the code snippet below with VM argument -Xmx512m . This will work flawlessy
      2) Execute the same code with -Xmx1024m, the JVM will crash as mentioned

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No crash from the JVM
      ACTUAL -
      JVM dies with the next message in the console:

      #
      # An unexpected error has been detected by HotSpot Virtual Machine:
      #
      # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x071a7742, pid=1852, tid=2896
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.2_09-b05 mixed mode)
      # Problematic frame:
      # C [awt.dll+0x37742]
      #
      # An error report file with more information is saved as hs_err_pid1852.log
      #
      # If you would like to submit a bug report, please visit:
      # http://java.sun.com/webapps/bugreport/crash.jsp
      #
      java.lang.OutOfMemoryError


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      content of the log file:

      #
      # An unexpected error has been detected by HotSpot Virtual Machine:
      #
      # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x071a7742, pid=1852, tid=2896
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.2_09-b05 mixed mode)
      # Problematic frame:
      # C [awt.dll+0x37742]
      #

      --------------- T H R E A D ---------------

      Current thread (0x00355e40): JavaThread "main" [_thread_in_native, id=2896]

      siginfo: ExceptionCode=0xc0000005, reading address 0x00000018

      Registers:
      EAX=0x00000000, EBX=0x073b900c, ECX=0x0006f75c, EDX=0x77c61b90
      ESP=0x0006f6ac, EBP=0x0006f6d8, ESI=0x073b9008, EDI=0x0000208e
      EIP=0x071a7742, EFLAGS=0x00010246

        Top of Stack: (sp=0x0006f6ac)
      0x0006f6ac: 071a90a9 00000000 00000001 00000004
      0x0006f6bc: 0000208e 00001830 00000000 00000001
      0x0006f6cc: 77c4186a 073b900c 0000208e 0006f76c
      0x0006f6dc: 071a7f99 00355edc 00001830 0006f75c
      0x0006f6ec: 0006f754 00000001 00000001 00000000
      0x0006f6fc: 00355e40 50474b98 50474b50 f707cd61
      0x0006f70c: 3f7b85dd 00000000 00000000 00000000
      0x0006f71c: 00000000 00000000 00000000 21bc86f2

      Instructions: (pc=0x071a7742)
      0x071a7732: 5b c9 c2 18 00 8b 44 24 04 8b 00 c3 8b 44 24 04
      0x071a7742: 8b 40 18 c3 55 8b ec 83 ec 4c 53 8b 5d 08 56 57


      Stack: [0x00030000,0x00070000), sp=0x0006f6ac, free space=253k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      C [awt.dll+0x37742]
      C [awt.dll+0x37f99]
      j sun.awt.image.ImagingLib.transformBI(Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;[DI)I+0
      j sun.awt.image.ImagingLib.filter(Ljava/awt/image/BufferedImageOp;Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage;+194
      j java.awt.image.AffineTransformOp.filter(Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage;+356
      j sun.java2d.pipe.DrawImage.transformImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IILjava/awt/image/BufferedImageOp;Ljava/awt/geom/AffineTransform;Ljava/awt/Color;)V+906
      j sun.java2d.pipe.DrawImage.scaleImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IIIILjava/awt/Color;)Z+132
      j sun.java2d.pipe.DrawImage.scaleImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IIIILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+19
      j sun.java2d.pipe.ValidatePipe.scaleImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IIIILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+21
      j sun.java2d.SunGraphics2D.drawImage(Ljava/awt/Image;IIIILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+74
      j sun.java2d.SunGraphics2D.drawImage(Ljava/awt/Image;IIIILjava/awt/image/ImageObserver;)Z+11
      j aaa.accessviolation.MainAccessViolation.getScaledInstance(II)V+126
      j aaa.accessviolation.MainAccessViolation.main([Ljava/lang/String;)V+96
      v ~StubRoutines::call_stub
      V [jvm.dll+0x71bdf]
      V [jvm.dll+0xabac2]
      V [jvm.dll+0x71aec]
      V [jvm.dll+0x778e9]
      V [jvm.dll+0x7854e]
      C [javaw.exe+0x14bf]
      C [javaw.exe+0x2ecf]
      C [kernel32.dll+0x16fd7]

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j sun.awt.image.ImagingLib.transformBI(Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;[DI)I+0
      j sun.awt.image.ImagingLib.filter(Ljava/awt/image/BufferedImageOp;Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage;+194
      j java.awt.image.AffineTransformOp.filter(Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage;+356
      j sun.java2d.pipe.DrawImage.transformImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IILjava/awt/image/BufferedImageOp;Ljava/awt/geom/AffineTransform;Ljava/awt/Color;)V+906
      j sun.java2d.pipe.DrawImage.scaleImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IIIILjava/awt/Color;)Z+132
      j sun.java2d.pipe.DrawImage.scaleImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IIIILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+19
      j sun.java2d.pipe.ValidatePipe.scaleImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IIIILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+21
      j sun.java2d.SunGraphics2D.drawImage(Ljava/awt/Image;IIIILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+74
      j sun.java2d.SunGraphics2D.drawImage(Ljava/awt/Image;IIIILjava/awt/image/ImageObserver;)Z+11
      j aaa.accessviolation.MainAccessViolation.getScaledInstance(II)V+126
      j aaa.accessviolation.MainAccessViolation.main([Ljava/lang/String;)V+96
      v ~StubRoutines::call_stub

      --------------- P R O C E S S ---------------

      Java Threads: ( => current thread )
        0x009f1498 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=1896]
        0x009eedc8 JavaThread "AWT-Windows" daemon [_thread_in_native, id=4024]
        0x0731e210 JavaThread "AWT-Shutdown" [_thread_blocked, id=268]
        0x0035e420 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3924]
        0x0035d788 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2664]
        0x009a3440 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=4064]
        0x009a2680 JavaThread "JDWP Event Helper Thread" daemon [_thread_in_native, id=3384]
        0x009a1ca0 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_native, id=2900]
        0x0099e800 JavaThread "Finalizer" daemon [_thread_blocked, id=2640]
        0x0099d3f0 JavaThread "Reference Handler" daemon [_thread_blocked, id=3680]
      =>0x00355e40 JavaThread "main" [_thread_in_native, id=2896]

      Other Threads:
        0x009df218 VMThread [id=2292]
        0x009e0108 WatcherThread [id=3580]

      VM state:not at safepoint (normal execution)

      VM Mutex/Monitor currently owned by a thread: None

      Heap
       def new generation total 11840K, used 0K [0x10010000, 0x10ce0000, 0x14ed0000)
        eden space 10560K, 0% used [0x10010000, 0x100101b8, 0x10a60000)
        from space 1280K, 0% used [0x10a60000, 0x10a60000, 0x10ba0000)
        to space 1280K, 0% used [0x10ba0000, 0x10ba0000, 0x10ce0000)
       tenured generation total 156704K, used 13455K [0x14ed0000, 0x1e7d8000, 0x50010000)
         the space 156704K, 8% used [0x14ed0000, 0x15bf3d00, 0x15bf3e00, 0x1e7d8000)
       compacting perm gen total 4608K, used 4530K [0x50010000, 0x50490000, 0x54010000)
         the space 4608K, 98% used [0x50010000, 0x5047c9b8, 0x5047ca00, 0x50490000)

      Dynamic libraries:
      0x00400000 - 0x0040b000 C:\j2sdk1.4.2_09\bin\javaw.exe
      0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
      0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll
      0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
      0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
      0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll
      0x77f10000 - 0x77f57000 C:\WINDOWS\system32\GDI32.dll
      0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
      0x08000000 - 0x0813d000 C:\j2sdk1.4.2_09\jre\bin\client\jvm.dll
      0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
      0x6bd00000 - 0x6bd0d000 C:\WINDOWS\system32\SYNCOR11.DLL
      0x10000000 - 0x10007000 C:\j2sdk1.4.2_09\jre\bin\hpi.dll
      0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
      0x00830000 - 0x0083e000 C:\j2sdk1.4.2_09\jre\bin\verify.dll
      0x00840000 - 0x00859000 C:\j2sdk1.4.2_09\jre\bin\java.dll
      0x00860000 - 0x0086e000 C:\j2sdk1.4.2_09\jre\bin\zip.dll
      0x00920000 - 0x0093c000 C:\j2sdk1.4.2_09\jre\bin\jdwp.dll
      0x00940000 - 0x00945000 C:\j2sdk1.4.2_09\jre\bin\dt_socket.dll
      0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\ws2_32.dll
      0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
      0x71a50000 - 0x71a8f000 C:\WINDOWS\System32\mswsock.dll
      0x76f20000 - 0x76f47000 C:\WINDOWS\system32\DNSAPI.dll
      0x76fb0000 - 0x76fb8000 C:\WINDOWS\System32\winrnr.dll
      0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll
      0x76fc0000 - 0x76fc6000 C:\WINDOWS\system32\rasadhlp.dll
      0x662b0000 - 0x66308000 C:\WINDOWS\system32\hnetcfg.dll
      0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll
      0x07170000 - 0x07283000 C:\j2sdk1.4.2_09\jre\bin\awt.dll
      0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV
      0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.dll
      0x774e0000 - 0x7761d000 C:\WINDOWS\system32\ole32.dll
      0x5ad70000 - 0x5ada8000 C:\WINDOWS\system32\uxtheme.dll
      0x074f0000 - 0x07541000 C:\j2sdk1.4.2_09\jre\bin\fontmanager.dll
      0x07560000 - 0x07583000 C:\j2sdk1.4.2_09\jre\bin\cmm.dll
      0x73760000 - 0x737a9000 C:\WINDOWS\system32\ddraw.dll
      0x73bc0000 - 0x73bc6000 C:\WINDOWS\system32\DCIMAN32.dll
      0x73940000 - 0x73a10000 C:\WINDOWS\system32\D3DIM700.DLL

      VM Arguments:
      jvm_args: -ea -Xmx1024m -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,suspend=y,address=localhost:1871
      java_command: aaa.accessviolation.MainAccessViolation

      Environment Variables:
      PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\IBM\CLIENT~1;C:\PROGRA~1\IBM\CLIENT~1\Shared;C:\PROGRA~1\IBM\CLIENT~1\Emulator;
      USERNAME=shendric
      OS=Windows_NT
      PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel


      --------------- S Y S T E M ---------------

      OS: Windows XP Build 2600 Service Pack 2

      CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2

      Memory: 4k page, physical 1014508k(248800k free), swap 2446780k(1656080k free)

      vm_info: Java HotSpot(TM) Client VM (1.4.2_09-b05) for windows-x86, built on Jul 25 2005 22:44:22 by "java_re" with MS VC++ 6.0



      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /*
      The PNG used in this snippet has the next properties:
      filesize on disk : 64.0kb
      dimensions : 8334 x 6192
      */

      package aaa.accessviolation;

      import java.awt.GraphicsConfiguration;
      import java.awt.GraphicsEnvironment;
      import java.awt.Image;
      import java.awt.Transparency;
      import java.awt.image.BufferedImage;
      import java.io.File;
      import java.io.FileInputStream;
      import java.io.InputStream;

      import javax.media.jai.JAI;
      import javax.media.jai.PlanarImage;
      import javax.swing.ImageIcon;

      import com.sun.media.jai.codec.FileCacheSeekableStream;

      public class MainAccessViolation
      {
      private transient Image fImage = null;
      private transient GraphicsConfiguration fGc = null;
      private transient BufferedImage fScaledImageBuffer = null;
      private int fHeight = 0;
      private int fWidth = 0;
      private int fScaledWidth = 0;
      private int fScaledHeight = 0;

      public MainAccessViolation(final Image image, final int w, final int h)
      {
      fGc = GraphicsEnvironment.
      getLocalGraphicsEnvironment().
      getDefaultScreenDevice().
      getDefaultConfiguration();
      fImage = image;
      fWidth = w;
      fHeight = h;
      }

      public final void getScaledInstance(final int width, final int height)
      {
      assert fGc != null;
      assert width >= 0;
      assert height >= 0;

      if ((fScaledImageBuffer == null) || (width != fScaledWidth) || (height != fScaledHeight))
      {
      fScaledImageBuffer = fGc.createCompatibleImage(Math.max(1, width), Math.max(1, height), Transparency.TRANSLUCENT);
      fScaledImageBuffer.getGraphics().drawImage(fImage, 0, 0, Math.max(1, width), Math.max(1, height), null);
      }
      }

      public static void main(String[] args)
      {
      try
      {
      System.out.println("Creating input ...");
      final InputStream input = new FileInputStream(new File("C:\\logo_northern_territory_crest_enlarged.PNG"));
      System.out.println("Creating ImageIcon ...");
      final ImageIcon i = (new ImageIcon(((PlanarImage)JAI.create("stream", new FileCacheSeekableStream(input))).getAsBufferedImage()));
      System.out.println("Creating MainAccessViolation ...");
      final MainAccessViolation main = new MainAccessViolation(i.getImage(), 8334, 6192);
      System.out.println("Calling getScaledInstance ...");
      main.getScaledInstance(56, 42);
      System.out.println("Finished");
      }
      catch (Exception e)
      {
      e.printStackTrace();
      }
      }
      }

      ---------- END SOURCE ----------

            Unassigned Unassigned
            bae Andrew Brygin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: