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

Drawing GeneralPath crashes JVM if antialias is on

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.0u1, 6
    • Fix Version/s: 6
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Resolved In Build:
      beta
    • CPU:
      generic, x86
    • OS:
      generic, linux, windows_xp

      Backports

        Description

        Name: au137807 Date: 08/20/2004



        Following code crashes JVM on Solaris, linux and WindowsXP.

        -------------Crash.java-------------
        import java.awt.Graphics2D;
        import java.awt.RenderingHints;
        import java.awt.image.BufferedImage;
        import java.awt.geom.GeneralPath;

        public class Crash {
            public static void main(String args[]) {
                BufferedImage im = new BufferedImage(640, 480,
                                                     BufferedImage.TYPE_INT_RGB);
                Graphics2D g2d = im.createGraphics();
                g2d.setRenderingHint (RenderingHints.KEY_ANTIALIASING,
                                      RenderingHints.VALUE_ANTIALIAS_ON);
                GeneralPath path = new GeneralPath();
                path.moveTo(0, 0);
                path.lineTo(634,25);
                path.lineTo(640,33);
                path.closePath();
                g2d.draw(path);
            }
        }
        -------------------------------------
        Here is the result of the execution on linux:

        #java -version
        java version "1.5.0-rc"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-rc-b63)
        Java HotSpot(TM) Client VM (build 1.5.0-rc-b63, mixed mode)

        java Crash

        #
        # An unexpected error has been detected by HotSpot Virtual Machine:
        #
        # SIGSEGV (0xb) at pc=0x4e3966a0, pid=2149, tid=1075277952
        #
        # Java VM: Java HotSpot(TM) Client VM (1.5.0-rc-b63 mixed mode)
        # Problematic frame:
        # C [libdcpr.so+0xb6a0]
        #
        # An error report file with more information is saved as hs_err_pid2149.log
        #
        # If you would like to submit a bug report, please visit:
        # http://java.sun.com/webapps/bugreport/crash.jsp
        #
        Aborted

        The same problem can be reproduced with following values:

        (634,25) (640,33)
        (634,57) (640,65)
        (634,89) (640,97)
        (634,121) (640,129)
        (634,153) (640,161)
        (634,185) (640,193)
        (634,217) (640,225)
        (634,249) (640,257)
        (634,281) (640,289)
        (634,313) (640,321)
        (634,345) (640,353)
        (634,377) (640,385)
        (634,409) (640,417)
        (634,441) (640,449)

        See bug 4587651 for more info.

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

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  avu Alexey Ushakov
                  Reporter:
                  avu Alexey Ushakov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: