Bug 62999

Summary: IBM JDK JIT causes AIOOBE in TexturePaintContext
Product: POI Reporter: Andreas Beeker <kiwiwings>
Component: SL CommonAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 4.0.x-dev   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Andreas Beeker 2018-12-10 16:16:12 UTC
While rendering our H/XSLF corpus, the IBM JDK failed to render certain shapes containing a texture fill.
This seems to be due a JIT bug, which can be worked around by adding the following JVM parameter:

-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V}

For further informations on how to determine and add JIT parameter check the IBM documentation
"JIT Problem Determination for IBM SDK using -Xjit" (http://www-01.ibm.com/support/docview.wss?uid=swg21294023)

In case the JVM argument isn't set, I've added a try/catch, but the texture paint will then be missing.


java.lang.Exception: While handling slideshow/2411-Performance_Up.pptx

	at org.apache.poi.TestAllFiles.testAllFiles(TestAllFiles.java:443)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
	at java.lang.reflect.Method.invoke(Method.java:508)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ArrayIndexOutOfBoundsException
	at java.awt.TexturePaintContext$Int.setRaster(TexturePaintContext.java:476)
	at java.awt.TexturePaintContext.getRaster(TexturePaintContext.java:236)
	at sun.java2d.pipe.AlphaPaintPipe.renderPathTile(AlphaPaintPipe.java:136)
	at sun.java2d.pipe.AAShapePipe.renderTiles(AAShapePipe.java:213)
	at sun.java2d.pipe.AAShapePipe.fillParallelogram(AAShapePipe.java:114)
	at sun.java2d.pipe.PixelToParallelogramConverter.fillRectangle(PixelToParallelogramConverter.java:334)
	at sun.java2d.pipe.PixelToParallelogramConverter.fill(PixelToParallelogramConverter.java:171)
	at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:172)
	at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2539)
	at org.apache.poi.sl.draw.DrawBackground.draw(DrawBackground.java:64)
	at org.apache.poi.sl.draw.DrawSlide.draw(DrawSlide.java:38)
	at org.apache.poi.xslf.usermodel.XSLFSlide.draw(XSLFSlide.java:373)
	at org.apache.poi.stress.SlideShowHandler.renderSlides(SlideShowHandler.java:117)
	at org.apache.poi.stress.SlideShowHandler.handleSlideShow(SlideShowHandler.java:43)
	at org.apache.poi.stress.XSLFFileHandler.handleFile(XSLFFileHandler.java:43)
	at org.apache.poi.TestAllFiles.testAllFiles(TestAllFiles.java:417)
	... 31 more
Comment 1 Andreas Beeker 2018-12-10 16:19:22 UTC
fixed via r1848601