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

VM crashes (stack overflow) when using BasicStroke.createStrokedShape()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.1, 1.4.2, 5.0, 5.0u5
    • client-libs
    • 2d
    • generic, x86
    • generic, windows_2000, windows_xp



      Name: tb29552 Date: 05/28/2004


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

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

      A DESCRIPTION OF THE PROBLEM :
      When creating a particular GeneralPath (this can be reproduced only with some GeneralPath), a BasicStroke with dashes line and calling createStrokedShape() on it the VM crashes.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the attached sample

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      "Program End" appears in the console and that's all.
      ACTUAL -
      The VM crashes before printing out the text.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      An unrecoverable stack overflow has occurred.

      An unexpected exception has been detected in native code outside the VM.
      Unexpected Signal : EXCEPTION_STACK_OVERFLOW (0xc00000fd) occurred at PC=0x77C4B
      250
      Function=ftol+0x0
      Library=C:\WINDOWS\system32\MSVCRT.dll

      Current Java thread:
              at sun.dc.pr.PathDasher.appendCubic(Native Method)
              at Test.run(Test.java:38)
              at Test.main(Test.java:12)

      Dynamic libraries:
      0x00400000 - 0x00406000 d:\jdk1.4.2\bin\java.exe
      0x77F50000 - 0x77FF7000 C:\WINDOWS\System32\ntdll.dll
      0x77E60000 - 0x77F46000 C:\WINDOWS\system32\kernel32.dll
      0x77DD0000 - 0x77E5D000 C:\WINDOWS\system32\ADVAPI32.dll
      0x78000000 - 0x78086000 C:\WINDOWS\system32\RPCRT4.dll
      0x77C10000 - 0x77C63000 C:\WINDOWS\system32\MSVCRT.dll
      0x08000000 - 0x08136000 d:\jdk1.4.2\jre\bin\client\jvm.dll
      0x77D40000 - 0x77DC6000 C:\WINDOWS\system32\USER32.dll
      0x77C70000 - 0x77CB0000 C:\WINDOWS\system32\GDI32.dll
      0x76B40000 - 0x76B6C000 C:\WINDOWS\System32\WINMM.dll
      0x76390000 - 0x763AC000 C:\WINDOWS\System32\IMM32.DLL
      0x629C0000 - 0x629C8000 C:\WINDOWS\System32\LPK.DLL
      0x72FA0000 - 0x72FFA000 C:\WINDOWS\System32\USP10.dll
      0x10000000 - 0x10007000 d:\jdk1.4.2\jre\bin\hpi.dll
      0x003A0000 - 0x003AE000 d:\jdk1.4.2\jre\bin\verify.dll
      0x003B0000 - 0x003C8000 d:\jdk1.4.2\jre\bin\java.dll
      0x003D0000 - 0x003DD000 d:\jdk1.4.2\jre\bin\zip.dll
      0x02C60000 - 0x02D6A000 D:\jdk1.4.2\jre\bin\awt.dll
      0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV
      0x771B0000 - 0x772D1000 C:\WINDOWS\system32\ole32.dll
      0x02D80000 - 0x02DA2000 D:\jdk1.4.2\jre\bin\dcpr.dll
      0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\imagehlp.dll
      0x6D510000 - 0x6D58D000 C:\WINDOWS\system32\DBGHELP.dll
      0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
      0x76BF0000 - 0x76BFB000 C:\WINDOWS\System32\PSAPI.DLL

      Heap at VM Abort:
      Heap
       def new generation

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.BasicStroke;
      import java.awt.geom.GeneralPath;


      public class Test {
        public static void main(String[] args) {
          new Test().run();
        }

        // CJO 05/04
        public void run() {
          int rule = 1;
          GeneralPath path = new GeneralPath(rule);
          path.moveTo(447323.06f, -4413419.0f);
          path.curveTo(447442.28f, -4413560.0f, 447484.44f, -4413554.0f, 447503.0f, -4413491.5f);
          path.curveTo(447521.56f, -4413429.5f, 447532.72f,-4413387.0f, 447527.84f, -4413382.0f);
          
          float[] dash = {4f,4f};
          float dash_phase = 0.0f;
          
          BasicStroke stroke = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER,
                                                      10.0f, dash, dash_phase);
          
          stroke.createStrokedShape(path);
          System.out.println("Program End");
        }

      ---------- END SOURCE ----------
      (Incident Review ID: 275425)
      ======================================================================

            avu Alexey Ushakov
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: