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

Draw glyph cause JVM crash

XMLWordPrintable

    • 2d
    • b27
    • x86
    • os_x, windows_2008

      FULL PRODUCT VERSION :
      java version "1.6.0_30"
      Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
      Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      ver: window server 2008 R2 Enterprise

      A DESCRIPTION OF THE PROBLEM :
      I have a corrupted true type font file. I loaded it with Font.createFont(…). When call drawGlyphVector(...), JVM crashed. This font file is from a PDF Document. I can’t determinate if the font file is corrupted or not, before I pass it to Java.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      running my test program

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      throw an exception
      ACTUAL -
      JVM crashed

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # EXCEPTION_INT_DIVIDE_BY_ZERO (0xc0000094) at pc=0x000000006d35472e, pid=4220, tid=5096
      #
      # JRE version: 6.0_30-b12
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.5-b03 mixed mode windows-amd64 compressed oops)
      # Problematic frame:
      # C [fontmanager.dll+0x1472e]
      #
      # If you would like to submit a bug report, please visit:
      # http://java.sun.com/webapps/bugreport/crash.jsp
      # The crash happened outside the Java Virtual Machine in native code.
      # See problematic frame for where to report the bug.
      #

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

      Current thread (0x00000000001dc000): JavaThread "main" [_thread_in_native, id=5096, stack(0x00000000023e0000,0x00000000024e0000)]

      siginfo: ExceptionCode=0xc0000094

      Registers:
      RAX=0x0000000000010000, RBX=0x0000000000000000, RCX=0x0000000000010000, RDX=0x0000000000000000
      RSP=0x00000000024df258, RBP=0x0000000000000048, RSI=0x0000000000010000, RDI=0x0000000000010000
      R8 =0x0000000000000000, R9 =0x0000000000000001, R10=0x0000000000000000, R11=0x0000000000000001
      R12=0x0000000000000048, R13=0x00000000062dafc0, R14=0x00000000024df360, R15=0x0000000000010000
      RIP=0x000000006d35472e, EFLAGS=0x0000000000010246

        Top of Stack: (sp=0x00000000024df258)
      0x00000000024df258: 000000006d3507c5 0000000000000000
      0x00000000024df268: 0000000000000000 0000000000000000
      0x00000000024df278: 0000000000000000 0000000000000000
      0x00000000024df288: 000000006d000000 0000000000010000
      0x00000000024df298: 0000000002530620 0000000000000000
      0x00000000024df2a8: 0000000002530636 0000000000000001
      0x00000000024df2b8: 0000000000000000 00000000062dafc0
      0x00000000024df2c8: 00000000024df508 0000000000000060
      0x00000000024df2d8: 0000000000000001 0000000000000000
      0x00000000024df2e8: 00000000062dafc0 00000000001dc1d0
      0x00000000024df2f8: 0000000006216c50 000000000000000b
      0x00000000024df308: 0000000006216c50 00000000062dafc0
      0x00000000024df318: 000000006d36a933 00000000062dafc0
      0x00000000024df328: 0000000000000002 0000000000000048
      0x00000000024df338: 0000000000000048 00000000024df360
      0x00000000024df348: 0000000000000001 00000000024df390

      Instructions: (pc=0x000000006d35472e)
      0x000000006d35470e: 1b 41 b9 01 00 00 00 eb 10 85 d2 41 b9 01 00 00
      0x000000006d35471e: 00 79 09 41 b9 ff ff ff ff 41 f7 d8 33 d2 8b c1
      0x000000006d35472e: 41 f7 f0 44 8b d0 b8 ff ff 00 00 8b ca 41 c1 e2
      0x000000006d35473e: 10 3b d0 76 09 d1 e9 41 d1 f8 3b c8 77 f7 c1 e1


      Register to memory mapping:

      RAX=0x0000000000010000 is an unknown value
      RBX=0x0000000000000000 is an unknown value
      RCX=0x0000000000010000 is an unknown value
      RDX=0x0000000000000000 is an unknown value
      RSP=0x00000000024df258 is pointing into the stack for thread: 0x00000000001dc000
      RBP=0x0000000000000048 is an unknown value
      RSI=0x0000000000010000 is an unknown value
      RDI=0x0000000000010000 is an unknown value
      R8 =0x0000000000000000 is an unknown value
      R9 =0x0000000000000001 is an unknown value
      R10=0x0000000000000000 is an unknown value
      R11=0x0000000000000001 is an unknown value
      R12=0x0000000000000048 is an unknown value
      R13=0x00000000062dafc0 is an unknown value
      R14=0x00000000024df360 is pointing into the stack for thread: 0x00000000001dc000
      R15=0x0000000000010000 is an unknown value


      Stack: [0x00000000023e0000,0x00000000024e0000], sp=0x00000000024df258, free space=1020k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      C [fontmanager.dll+0x1472e]

      [error occurred during error reporting (printing native stack), id 0xc0000005]

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j sun.font.FileFont.getGlyphImage(JI)J+0
      j sun.font.FileFontStrike.getGlyphImagePtr(I)J+115
      j sun.font.FileFontStrike.getGlyphMetrics(IZ)Ljava/awt/geom/Point2D$Float;+29
      j sun.font.FileFontStrike.getGlyphMetrics(I)Ljava/awt/geom/Point2D$Float;+3
      j sun.font.StandardGlyphVector$GlyphStrike.addDefaultGlyphAdvance(ILjava/awt/geom/Point2D$Float;)V+5
      j sun.font.StandardGlyphVector.initPositions()V+162
      j sun.font.StandardGlyphVector.setupGlyphImages([J[F[D)Ljava/lang/Object;+1
      j sun.font.GlyphList.setFromGlyphVector(Lsun/java2d/loops/FontInfo;Ljava/awt/font/GlyphVector;FF)V+90
      j sun.java2d.pipe.GlyphListPipe.drawGlyphVector(Lsun/java2d/SunGraphics2D;Ljava/awt/font/GlyphVector;FF)V+129
      j sun.java2d.pipe.ValidatePipe.drawGlyphVector(Lsun/java2d/SunGraphics2D;Ljava/awt/font/GlyphVector;FF)V+17
      j sun.java2d.SunGraphics2D.drawGlyphVector(Ljava/awt/font/GlyphVector;FF)V+23
      j org.pdfbox.util.TestTrueTypeJVMCrash.main([Ljava/lang/String;)V+93
      v ~StubRoutines::call_stub

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

      Java Threads: ( => current thread )
        0x0000000006247000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=4932, stack(0x0000000007810000,0x0000000007910000)]
        0x0000000006246000 JavaThread "AWT-Shutdown" [_thread_blocked, id=688, stack(0x0000000007660000,0x0000000007760000)]
        0x0000000006215800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=4004, stack(0x0000000007560000,0x0000000007660000)]
        0x00000000061e6000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4500, stack(0x00000000072a0000,0x00000000073a0000)]
        0x00000000061d0000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=2712, stack(0x00000000071a0000,0x00000000072a0000)]
        0x00000000061b9800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=3440, stack(0x00000000070a0000,0x00000000071a0000)]
        0x00000000061b8800 JavaThread "Attach Listener" daemon [_thread_blocked, id=2644, stack(0x0000000006fa0000,0x00000000070a0000)]
        0x00000000061b7800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4752, stack(0x0000000006ea0000,0x0000000006fa0000)]
        0x0000000006164800 JavaThread "Finalizer" daemon [_thread_blocked, id=1720, stack(0x0000000006da0000,0x0000000006ea0000)]
        0x000000000615e000 JavaThread "Reference Handler" daemon [_thread_blocked, id=836, stack(0x0000000006ca0000,0x0000000006da0000)]
      =>0x00000000001dc000 JavaThread "main" [_thread_in_native, id=5096, stack(0x00000000023e0000,0x00000000024e0000)]

      Other Threads:
        0x0000000006154800 VMThread [stack: 0x0000000006ba0000,0x0000000006ca0000] [id=4000]
        0x00000000061f7800 WatcherThread [stack: 0x00000000073a0000,0x00000000074a0000] [id=1912]

      VM state:not at safepoint (normal execution)

      VM Mutex/Monitor currently owned by a thread: None

      Heap
       PSYoungGen total 28672K, used 1474K [0x00000000f5560000, 0x00000000f7560000, 0x0000000100000000)
        eden space 24576K, 6% used [0x00000000f5560000,0x00000000f56d0aa8,0x00000000f6d60000)
        from space 4096K, 0% used [0x00000000f7160000,0x00000000f7160000,0x00000000f7560000)
        to space 4096K, 0% used [0x00000000f6d60000,0x00000000f6d60000,0x00000000f7160000)
       PSOldGen total 65536K, used 0K [0x00000000e0000000, 0x00000000e4000000, 0x00000000f5560000)
        object space 65536K, 0% used [0x00000000e0000000,0x00000000e0000000,0x00000000e4000000)
       PSPermGen total 21248K, used 5960K [0x00000000dae00000, 0x00000000dc2c0000, 0x00000000e0000000)
        object space 21248K, 28% used [0x00000000dae00000,0x00000000db3d2270,0x00000000dc2c0000)

      Code Cache [0x00000000024e0000, 0x0000000002750000, 0x00000000054e0000)
       total_blobs=323 nmethods=1 adapters=276 free_code_cache=49862976 largest_free_block=320

      Dynamic libraries:
      0x0000000000400000 - 0x000000000042f000 C:\Program Files\Java\jdk6u30\jre\bin\java.exe
      0x0000000076e00000 - 0x0000000076fa9000 C:\Windows\SYSTEM32\ntdll.dll
      0x0000000076ce0000 - 0x0000000076dff000 C:\Windows\system32\kernel32.dll
      0x000007fefc530000 - 0x000007fefc59c000 C:\Windows\system32\KERNELBASE.dll
      0x000007fefd7c0000 - 0x000007fefd89b000 C:\Windows\system32\ADVAPI32.dll
      0x000007fefd8a0000 - 0x000007fefd93f000 C:\Windows\system32\msvcrt.dll
      0x000007fefe5d0000 - 0x000007fefe5ef000 C:\Windows\SYSTEM32\sechost.dll
      0x000007fefdd10000 - 0x000007fefde3d000 C:\Windows\system32\RPCRT4.dll
      0x000000006d8b0000 - 0x000000006e068000 C:\Program Files\Java\jdk6u30\jre\bin\server\jvm.dll
      0x0000000076be0000 - 0x0000000076cda000 C:\Windows\system32\USER32.dll
      0x000007fefe0a0000 - 0x000007fefe107000 C:\Windows\system32\GDI32.dll
      0x000007fefc600000 - 0x000007fefc60e000 C:\Windows\system32\LPK.dll
      0x000007fefdbf0000 - 0x000007fefdcb9000 C:\Windows\system32\USP10.dll
      0x000007fef9a30000 - 0x000007fef9a6b000 C:\Windows\system32\WINMM.dll
      0x000007fefd710000 - 0x000007fefd73e000 C:\Windows\system32\IMM32.DLL
      0x000007fefc6b0000 - 0x000007fefc7b9000 C:\Windows\system32\MSCTF.dll
      0x000000006d820000 - 0x000000006d82e000 C:\Program Files\Java\jdk6u30\jre\bin\verify.dll
      0x000000006d450000 - 0x000000006d477000 C:\Program Files\Java\jdk6u30\jre\bin\java.dll
      0x000000006d870000 - 0x000000006d882000 C:\Program Files\Java\jdk6u30\jre\bin\zip.dll
      0x000000006d0a0000 - 0x000000006d264000 C:\Program Files\Java\jdk6u30\jre\bin\awt.dll
      0x000007feef340000 - 0x000007feef3b1000 C:\Windows\system32\WINSPOOL.DRV
      0x000007fefe310000 - 0x000007fefe513000 C:\Windows\system32\ole32.dll
      0x000007fefc7c0000 - 0x000007fefd548000 C:\Windows\system32\SHELL32.dll
      0x000007fefd740000 - 0x000007fefd7b1000 C:\Windows\system32\SHLWAPI.dll
      0x000007fefaca0000 - 0x000007fefae94000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll
      0x000000006d340000 - 0x000000006d3a6000 C:\Program Files\Java\jdk6u30\jre\bin\fontmanager.dll
      0x000000006d6b0000 - 0x000000006d6c7000 C:\Program Files\Java\jdk6u30\jre\bin\net.dll
      0x000007fefdcc0000 - 0x000007fefdd0d000 C:\Windows\system32\WS2_32.dll
      0x000007fefe520000 - 0x000007fefe528000 C:\Windows\system32\NSI.dll
      0x000007fefba60000 - 0x000007fefbab5000 C:\Windows\system32\mswsock.dll
      0x000007fefba50000 - 0x000007fefba57000 C:\Windows\System32\wship6.dll
      0x000000006d6d0000 - 0x000000006d6db000 C:\Program Files\Java\jdk6u30\jre\bin\nio.dll
      0x000007fefa420000 - 0x000007fefa438000 C:\Windows\system32\DWMAPI.DLL
      0x000007fefc120000 - 0x000007fefc12f000 C:\Windows\system32\CRYPTBASE.dll
      0x0000000076fc0000 - 0x0000000076fc7000 C:\Windows\system32\PSAPI.DLL
      0x000007fefe870000 - 0x000007fefe995000 C:\Windows\system32\dbghelp.dll

      VM Arguments:
      jvm_args: -Dfile.encoding=Cp1252 -Xmx512m
      java_command: org.pdfbox.util.TestTrueTypeJVMCrash -test -config ../mark configuration/techdoc_mark.xml
      Launcher Type: SUN_STANDARD

      Environment Variables:
      JAVA_HOME=D:\TechDoc\jre8
      PATH=C:\Program Files (x86)\ImageMagick-6.6.9-Q8;c:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;c:\bin;D:\TechDoc\bin;D:\TechDoc\jre8\bin\;c:\program files (x86)\java\jdk6u20\bin;D:\Plugins\image\ImageMagick-windows\ImageMagick-6.6.9\VisualMagick\bin
      USERNAME=jundai
      OS=Windows_NT
      PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 26 Stepping 5, GenuineIntel



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

      OS: Windows NT 6.1 , 64 bit Build 7601 Service Pack 1

      CPU:total 8 (4 cores per cpu, 2 threads per core) family 6 model 26 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, ht

      Memory: 4k page, physical 6289880k(3201628k free), swap 12577912k(9246860k free)

      vm_info: Java HotSpot(TM) 64-Bit Server VM (20.5-b03) for windows-amd64 JRE (1.6.0_30-b12), built on Nov 10 2011 01:49:46 by "java_re" with MS VC++ 8.0 (VS2005)

      time: Wed Feb 01 16:59:33 2012
      elapsed time: 0 seconds

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Color;
      import java.awt.Font;
      import java.awt.Graphics2D;
      import java.awt.font.GlyphVector;
      import java.awt.geom.AffineTransform;
      import java.awt.image.BufferedImage;
      import java.io.*;

      public class TestTrueTypeJVMCrash
      {
        public static void main(String argv[])
        {
          try
          {
            Font theFont = Font.createFont(Font.TRUETYPE_FONT, new File("jvmcrashFont.ttf"));
            BufferedImage img = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
            Graphics2D gs = img.createGraphics();
            int glyphindex [] ={1};
            GlyphVector glyph = theFont.createGlyphVector(gs.getFontRenderContext(), glyphindex);
            if(glyph != null)
            {
              gs.setTransform(new AffineTransform(10, 0, 0, 10, 20, 20));
              gs.setColor(Color.RED);
              gs.drawGlyphVector(glyph, 0, 0);
              gs.setTransform(new AffineTransform());
            }
          }
          catch(Exception e)
          {
            e.printStackTrace();
          }
        }
        
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I don't have a work around at this moment.

            prr Philip Race
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: