JDK-6966105 : PathDasher.appendCubic crash
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u10,7u80
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: linux
  • CPU: x86
  • Submitted: 2010-07-01
  • Updated: 2020-04-07
  • Resolved: 2019-03-25
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux appserver05 2.6.24-24-generic #1 SMP Fri Sep 18 16:16:18 UTC 2009 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
This is a server application using Java2D to render map images in a headless environment. Multiple map images may be requested in parallel.

Roughly once a day, the java process segfaults. After each crash, we use visualvm on the core dump. The problematic stacktrace is shown below.

Thread 18032 "TP-Processor15": (state = IN_NATIVE)
 	at sun.dc.pr.PathDasher.appendCubic(Native Method)
 	at sun.dc.pr.Rasterizer.appendCubic(Rasterizer.java:520)
 	at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:553)
 	at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:97)
 	at sun.java2d.pipe.DuctusShapeRenderer.draw(DuctusShapeRenderer.java:46)
 	at sun.java2d.pipe.PixelToParallelogramConverter.draw(PixelToParallelogramConverter.java:130)
 	at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2336)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Have not been able to create a reproducible case.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No crash
ACTUAL -
Crash. Core dumped.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
The java process does not write a hs_err_pid file.

REPRODUCIBILITY :
This bug can be reproduced occasionally.

---------- BEGIN SOURCE ----------
Have not been able to create a reproducible case.
---------- END SOURCE ----------
Additional input from submitter:

% javac PathDasherSegfault.java
% java PathDasherSegfault
about to draw
Segmentation fault (core dumped)


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
about to draw
OK
ACTUAL -
about to draw
Segmentation fault (core dumped)

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java does not create any hs_err_pid file in this case

The stack-trace from the core-file:
Thread 18032 "TP-Processor15": (state = IN_NATIVE)
    at sun.dc.pr.PathDasher.appendCubic(Native Method)
    at sun.dc.pr.Rasterizer.appendCubic(Rasterizer.java:520)
    at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:553)
    at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:97)
    at sun.java2d.pipe.DuctusShapeRenderer.draw(DuctusShapeRenderer.java:46)
    at sun.java2d.pipe.PixelToParallelogramConverter.draw(PixelToParallelogramConverter.java:130)
    at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2336)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.BasicStroke;
import java.awt.Graphics2D;
import java.awt.Stroke;
import java.awt.geom.GeneralPath;
import java.awt.image.BufferedImage;

public class PathDasherSegfault {

	public static void main(String[] args) {

		GeneralPath path = new GeneralPath(GeneralPath.WIND_NON_ZERO);
		path.moveTo(8408685.0, -1124643.0);
		path.curveTo(8408693.0, -1124638.8, 8408703.0, -1124636.8, 8408712.0, -1124637.0);

		BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
		Graphics2D g2 = image.createGraphics();

		Stroke stroke = new BasicStroke(0.8503937f, BasicStroke.CAP_BUTT,
				BasicStroke.JOIN_MITER, 10f, new float[] { 10.204724f,
						5.102362f }, 0f);
		g2.setStroke(stroke);

		System.out.println("about to draw");
		g2.draw(path);
		System.out.println("OK");

	}

}

Comments
FWIW I reproduced this on 8u221 on Mac so the no-crash on 8u202 seems unlikely.
07-04-2020

I can't say why this is not reproducible in 8u202 but JDK 11 and later no longer ship the code where this crash occurs. So it should no longer be reproducible in current releases and I am closing it out as such.
25-03-2019

I ran the code on different oracle jdks on windows 7: 1.7.0_80 crash 1.8.0_202 ok 9.0.4 ok 10.0.2 ok 11.0.2 ok 12 ok
25-03-2019