Bug 1582032

Summary: OpenJDK8 ArrayIndexOutOfBoundsException at sun.java2d.pisces.Dasher.goTo(Dasher.java:151)
Product: Red Hat Enterprise Linux 7 Reporter: kazuhiro kawana <kkawana>
Component: java-1.8.0-openjdkAssignee: Andrew John Hughes <ahughes>
Status: CLOSED ERRATA QA Contact: zzambers
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: ahughes, dbhole, jdoyle, jvanek
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: java-1.8.0-openjdk-1.8.0.181-4.b04.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 07:42:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description kazuhiro kawana 2018-05-24 02:48:33 UTC
### Description of problem:
We could not transcode from SVG to JPG using “apache batik svg toolkit” and OpenJDK8.

A same issue was reported in JDK bug database and already fixed:

https://bugs.openjdk.java.net/browse/JDK-8075942
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/5b07559a4547

I checked source code in src rpm, it looks OpenJDK 8(latest) does not contain the above fix. Please a backport the fix.


### Version-Release number of selected component (if applicable):
— java-1.8.0-openjdk-1.8.0.77-0.b03.el7_2.x86_64
— batik-bin-1.9 (You can download from http://ftp.jaist.ac.jp/pub/apache/xmlgraphics/batik/binaries/)


### How reproducible:

Anytime


### Steps to Reproduce:
1: Install latest openjdk 8 : 

I installed java-1.8.0-openjdk-1.8.0.77-0.b03.el7_2.

2: Download/unzip apache batik :

I downloaded/unzip batik-bin-1.9.zip.

3: Comple sample code “SaveAsJPEG.java” :

Ex)
$javac -classpath batik-1.9/batik-1.9.jar SaveAsJPEG.java

5: Execute sample code “SaveAsJPEG.java” and Transcode sample svg file “NG.svg” :

$ java -cp .:batik-1.9/batik-1.9.jar -Djava.awt.headless=true SaveAsJPEG NG.svg NG.jpg 400 200

*** I attached sample code/svg files this bug. Please check it. ***


### Actual results:

# java -cp .:batik-1.9/batik-1.9.jar -Djava.awt.headless=true SaveAsJPEG NG.svg NG.jpg 400 200
org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
null
    at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:132)
    at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
    at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)
    at SaveAsJPEG.main(SaveAsJPEG.java:40)
Caused by the underlying exception: java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Native Method)
    at sun.java2d.pisces.Dasher.goTo(Dasher.java:151)
    at sun.java2d.pisces.Dasher.lineTo(Dasher.java:188)
    at sun.java2d.pipe.RenderingEngine.feedConsumer(RenderingEngine.java:366)
    at sun.java2d.pisces.PiscesRenderingEngine.pathTo(PiscesRenderingEngine.java:484)
    at sun.java2d.pisces.PiscesRenderingEngine.strokeTo(PiscesRenderingEngine.java:363)
    at sun.java2d.pisces.PiscesRenderingEngine.createStrokedShape(PiscesRenderingEngine.java:69)
    at java.awt.BasicStroke.createStrokedShape(BasicStroke.java:301)
    at org.apache.batik.gvt.StrokeShapePainter.getPaintedArea(StrokeShapePainter.java:125)
    at org.apache.batik.gvt.StrokeShapePainter.getPaintedBounds2D(StrokeShapePainter.java:134)
    at org.apache.batik.gvt.CompositeShapePainter.getPaintedBounds2D(CompositeShapePainter.java:156)
    at org.apache.batik.gvt.ShapeNode.getPrimitiveBounds(ShapeNode.java:238)
    at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedPrimitiveBounds(AbstractGraphicsNode.java:854)
    at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:820)
    at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:224)
    at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:295)
    at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:820)
    at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:207)
    at org.apache.batik.gvt.filter.GraphicsNodeRable8Bit.getBounds2D(GraphicsNodeRable8Bit.java:156)
    at org.apache.batik.gvt.filter.GraphicsNodeRable8Bit.createRendering(GraphicsNodeRable8Bit.java:261)
    at org.apache.batik.gvt.renderer.StaticRenderer.renderGNR(StaticRenderer.java:481)
    at org.apache.batik.gvt.renderer.StaticRenderer.updateWorkingBuffers(StaticRenderer.java:508)
    at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:375)
    at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:344)
    at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:111)
    at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
    at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)
    at SaveAsJPEG.main(SaveAsJPEG.java:40)

### Expected results:

We expect to convert svg file to jpeg file without java.lang.ArrayIndexOutOfBoundsException.

Comment 3 kazuhiro kawana 2018-05-24 03:11:08 UTC
Note:

OpenJDK version miss..
### Version-Release number of selected component (if applicable):
— java-1.8.0-openjdk-1.8.0.77-0.b03.el7_2.x86_64
— batik-bin-1.9 (You can download from http://ftp.jaist.ac.jp/pub/apache/xmlgraphics/batik/binaries/)

--->

Correct version is:
### Version-Release number of selected component (if applicable):
— java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64
— batik-bin-1.9 (You can download from http://ftp.jaist.ac.jp/pub/apache/xmlgraphics/batik/binaries/)

Comment 4 kazuhiro kawana 2018-05-24 03:13:20 UTC
### Additional Info:

The customer could reproduce this issue using openJDK1.8.0.151.

Comment 11 errata-xmlrpc 2018-10-30 07:42:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3017