Q: On a very specific PDF, our JVM crashes when converting PDF to images using Qoppa’s PDF library jPDFProcess. We’re running Java 1.7.

This is a part of the hs_err_pid.log file.

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 6438  sun.java2d.cmm.kcms.CMM.cmmCombineTransforms([Lsun/java2d/cmm/kcms/ICC_Transform;Lsun/java2d/cmm/kcms/ICC_Transform;)I (0 bytes) @ 0x00007ffff3fa6243 [0x00007ffff3fa61e0+0x63]
J 5050 C2 java.awt.image.ColorConvertOp.updateBITransform(Ljava/awt/color/ICC_Profile;Ljava/awt/color/ICC_Profile;)V (275 bytes) @ 0x00007ffff3ac2254 [0x00007ffff3ac1c20+0x634]
J 6439 C2 java.awt.image.ColorConvertOp.filter(Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage; (175 bytes) @ 0x00007ffff3316ef8 [0x00007ffff3316dc0+0x138]
J 5167 C2 sun.java2d.loops.Blit$AnyBlit.Blit(Lsun/java2d/SurfaceData;Lsun/java2d/SurfaceData;Ljava/awt/Composite;Lsun/java2d/pipe/Region;IIIIII)V (243 bytes) @ 0x00007ffff3b2f9e8 [0x00007ffff3b2efa0+0xa48]
J 6066 C2 sun.java2d.pipe.DrawImage.renderImageXform(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;Ljava/awt/geom/AffineTransform;IIIIILjava/awt/Color;)V (773 bytes) @ 0x00007ffff3dbd988 [0x00007ffff3dbc4c0+0x14c8]
J 6514 C2 sun.java2d.pipe.DrawImage.copyImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z (60 bytes) @ 0x00007ffff3f89330 [0x00007ffff3f88620+0xd10]
J 6865 C2 sun.java2d.SunGraphics2D.drawImage(Ljava/awt/Image;IILjava/awt/image/ImageObserver;)Z (11 bytes) @ 0x00007ffff3c6b664 [0x00007ffff3c6b580+0xe4]
j  com.qoppa.pdf.j.j.b(Ljava/awt/Image;II)V+8
j  com.qoppa.pdfViewer.k.m.b(Lcom/qoppa/pdf/j/j;Ljava/awt/Shape;Ljava/awt/geom/AffineTransform;)V+270
J 6427 C2 com.qoppa.pdf.j.j.b(Ljava/awt/Shape;Ljava/awt/geom/AffineTransform;)V (78 bytes) @ 0x00007ffff3f9ed30 [0x00007ffff3f9e9c0+0x370]
j  com.qoppa.pdf.j.d.s.b(Lcom/qoppa/pdf/j/j;)V+55
J 6689 C2 com.qoppa.pdfViewer.j.h.b(Lcom/qoppa/pdf/j/j;Ljava/awt/geom/AffineTransform;Ljava/awt/Color;)Ljava/awt/image/WritableRaster; (345 bytes) @ 0x00007ffff408d050 [0x00007ffff408be00+0x1250]
j  com.qoppa.pdf.k.h.b(Lcom/qoppa/pdf/j/j;Ljava/awt/geom/AffineTransform;)Lcom/qoppa/pdf/k/t;+89
J 6426 C2 com.qoppa.pdf.k.l.b(Lcom/qoppa/pdf/j/j;)Ljava/awt/Composite; (117 bytes) @ 0x00007ffff3fa1b5c [0x00007ffff3fa1480+0x6dc]
J 5907 C2 com.qoppa.pdfViewer.j.h.b(Lcom/qoppa/pdf/j/j;Ljava/awt/geom/AffineTransform;)V (176 bytes) @ 0x00007ffff3d80418 [0x00007ffff3d80340+0xd8]
j  com.qoppa.pdf.j.d.j.b(Lcom/qoppa/pdf/j/j;)V+157
J 4368 C2 com.qoppa.pdfViewer.j.n.c(Lcom/qoppa/pdf/j/j;)V (146 bytes) @ 0x00007ffff36a00dc [0x00007ffff369fe60+0x27c]
j  com.qoppa.pdfProcess.PDFPage.b(Lcom/qoppa/pdf/j/j;IILcom/qoppa/pdf/b/qb;)V+56
j  com.qoppa.pdfProcess.PDFPage.getImage(I)Ljava/awt/image/BufferedImage;+130
j  com.qoppa.pdfProcess.PDFPage.savePageAsJPEG(Ljava/io/OutputStream;IF)V+18
j  com.qoppa.pdfImages.PDFImages.savePageAsJPEG(ILjava/io/OutputStream;IF)V+12

A: This is an unfortunate bug that is documented in the openjdk database and has to do with color space management:

https://bugs.openjdk.java.net/browse/JDK-8053947

Fortunately, it only happens under very specific circumstances and only in PDF documents that use advanced color spaces such as magazines and brochures.

It can affect any of Qoppa’s rendering library and component products when running in Java 1.7 or Java 1.6, including jPDFViewer, jPDFNotes, jPDFEditor, jPDFImages, jPDFPrint and jPDFProcess.

Evaluation:

  • This issue has been reported in the kcms ( Kodak color management engine module ) that was used in JDK 7.
  • Since JDK 8, Java effectively uses – little cms color engine replacing kcms engine that was used earlier. Thus, the issue will not be reproducible in both JDK 8 and JDK 9.
  • In addition to the above fact, JDK 7 has reached the end of support phase.
  • There is no plan to fix this bug in Java 7 since it has reached the end of support phase.
  • The solution is to upgrade to Java 8 and above if this issue happens regularly in your workflow.