United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-5089985 Drawing GeneralPath crashes JVM if antialias is on
JDK-5089985 : Drawing GeneralPath crashes JVM if antialias is on

Details
Type:
Bug
Submit Date:
2004-08-20
Status:
Resolved
Updated Date:
2005-05-12
Project Name:
JDK
Resolved Date:
2004-11-22
Component:
client-libs
OS:
linux,generic,windows_xp
Sub-Component:
2d
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0,5.0u1,6
Fixed Versions:

Related Reports
Backport:
Backport:
Duplicate:
Duplicate:
Duplicate:

Sub Tasks

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.

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

                                    

Comments
EVALUATION

Not for tiger.
###@###.### 2004-08-20

The problem is that we are getting out of the float precision (in the boundary cases described in this CR) and starting to index out of the runs buffer.  
Finally, we crash in the runCheckForArcAppend method because of that.
So, the checking of the coordinates is required before entering to this method.
###@###.### 10/28/04 10:34 GMT
                                     
4-10-28 00:00:00
WORK AROUND

Name: au137807			Date: 08/20/2004


======================================================================
                                     
2004-08-28



Hardware and Software, Engineered to Work Together