JDK-4305163 : stack overflow problem with BasicStroke.createStrokedShape(huge cubic)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_7,windows_nt
  • CPU: x86,sparc
  • Submitted: 2000-01-18
  • Updated: 2012-10-10
  • Resolved: 2001-07-31
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description

Name: rlT66838			Date: 01/17/2000


H:\tmp\java>java -version
java version "1.3beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode)


An example program that shows the problem is given below.
These particular values seem to be tripping the intersects algorithm.

The error message is as follows:
H:\tmp\java>java Foobar
#
# HotSpot Virtual Machine Error, EXCEPTION_STACK_OVERFLOW
#
# Error ID: 4F533F57494E13120E43505002B0
#

abnormal program termination

--------------------------------------------------
import java.awt.geom.*;
import java.awt.*;

public class Foobar {
    public static void main(String[] args) {
	CubicCurve2D ccurve = new CubicCurve2D.Float(798049, 1219070,
						     797937, 1219280,
						     798047, 1219070,
						     797997, 1219180);
    
	Rectangle2D rect = new Rectangle2D.Float(796411, 1222113, 455, 753);
	if(intersectsOutline(ccurve, rect, new BasicStroke()))
	    System.out.println("Intersects!!");
    }
    public static boolean intersectsOutline(Shape shape, Rectangle2D rect,
Stroke stroke) {
	Shape stShape = stroke.createStrokedShape(shape);
	return stShape.intersects(rect);
    }
}
(Review ID: 99992) 
======================================================================

Name: elR10090			Date: 04/28/2001


This bug causes failure of the following testbase_nsk tests:

    nsk/regression/b4305163

Such record containing full test names allows to automatically 
generate the following list of known test failures (we maintain 
it updated every working day): 

    /net/sqesvr.eng/export/vsn/VM/testbase/nsk_stuff/buglist_nsk/nsk.knownbugs

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

Comments
WORK AROUND Name: rlT66838 Date: 01/17/2000 --None-- ======================================================================
11-06-2004

EVALUATION In build-S of hotspot jvm the crash no longer occours. However, the application aborts with: ABORT: Cannot handle stack overflow in native code. placing the hotspot dll from kestrel-S in JDK1.2.2 will pass the test. Also, I used editbin in a copy of java.exe to increase the thread stack size to ~3 megs using the following command line. editbin /STACK:3048576 java_copy.exe The jvm still abort with the above message. Leading me to believe that the bug maybe caused in the 2d dll. Jeannett, please let me know if I am completely off the base? Sorry for the fingure pointing. mohammad.gharahgouzloo@Eng 2000-01-21 The problem seems to be that the recursion in the Line Widening code is going on indefinately. 1.2.2 was able to complete the recursion on win32 which would seem to indicate that it will eventually terminate, but it could take an arbitrary number of recursive steps to do so. This particular crash is in dcPathStroker.c in processCubic, but processQuad seems to have the same vulnerability. jim.graham@Eng 2000-03-07
07-03-2000