OpenJDK 7 JVM crash in sun.java2d.cmm.lcms.LCMS.getTagData or sun.java2d.cmm.lcms.LCMS.createNativeTransform

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL) 6, 7
  • OpenJDK 7

Issue

  • After upgrading, we are running into a bug that other people seem to have hit as well with image rendering. The application (and JVM) crash in:

    sun.java2d.cmm.lcms.LCMS.getTagData
    

    or

    sun.java2d.cmm.lcms.LCMS.createNativeTransform
    
  • The full stack from the hs_err_pid log looks like:

#  SIGSEGV (0xb) at pc=0x00000033ade89bf0, pid=2089, tid=139687636227840
#
# JRE version: OpenJDK Runtime Environment (7.0_65-b17) (build 1.7.0_65-mockbuild_2014_07_14_06_19-b00)
# Java VM: OpenJDK 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x89bf0]

Stack: [0x00007f0b8fe7d000,0x00007f0b8fefe000],  sp=0x00007f0b8fef7bb8,  free space=490k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x89bf0]
C  0x0000000000000038
C  [libjavalcms.so+0x13dc0]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.java2d.cmm.lcms.LCMS.getTagData(JI[B)V+0
j  java.awt.color.ICC_Profile.getData(JI)[B+26
j  java.awt.color.ICC_Profile.getData(I)[B+14
j  java.awt.color.ICC_Profile.getNumComponents()I+18
j  sun.java2d.cmm.lcms.LCMSTransform.<init>(Ljava/awt/color/ICC_Profile;II)V+83
j  sun.java2d.cmm.lcms.LCMS.createTransform(Ljava/awt/color/ICC_Profile;II)Lsun/java2d/cmm/ColorTransform;+7
j  java.awt.color.ICC_ColorSpace.fromRGB([F)[F+37
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.setImageData(IIIII[B)V+158
v  ~StubRoutines::call_stub
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(JZZ)Z+0
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(Z)Z+12
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly()V+92
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(I)V+41
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(IZ)V+2
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(ILjavax/imageio/ImageReadParam;Z)Ljava/awt/image/Raster;+3
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.read(ILjavax/imageio/ImageReadParam;)Ljava/awt/image/BufferedImage;+15
j  javax.imageio.ImageIO.read(Ljavax/imageio/stream/ImageInputStream;)Ljava/awt/image/BufferedImage;+55
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fdddc925221, pid=9905, tid=140590895052544
#
# JRE version: OpenJDK Runtime Environment (7.0_101) (build 1.7.0_101-mockbuild_2016_04_19_08_45-b00)
# Java VM: OpenJDK 64-Bit Server VM (24.95-b01 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 2.6.6pre01
# Distribution: Red Hat Enterprise Linux Server release 6.7 (Santiago), package rhel-2.6.6.1.el6_7-x86_64 u101-b00
# Problematic frame:
# C  [libjavalcms.so+0x13221]
#

...(snip)..

Stack: [0x00007fddde4bb000,0x00007fddde5bc000],  sp=0x00007fddde5b8940,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libjavalcms.so+0x13221]
j  sun.java2d.cmm.lcms.LCMS.createNativeTransform([JIIILjava/lang/Object;)J+0
j  sun.java2d.cmm.lcms.LCMSTransform.doTransform(Lsun/java2d/cmm/lcms/LCMSImageLayout;Lsun/java2d/cmm/lcms/LCMSImageLayout;)V+88
j  sun.java2d.cmm.lcms.LCMSTransform.colorConvert([S[S)[S+92
j  java.awt.color.ICC_ColorSpace.fromRGB([F)[F+119
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.setImageData(IIIII[B)V+158
v  ~StubRoutines::call_stub
V  [libjvm.so+0x603e1e]
V  [libjvm.so+0x6029e8]
V  [libjvm.so+0x611a92]
V  [libjvm.so+0x6215ca]
C  [libjavajpeg.so+0x63be]  Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader+0x2ce
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(JZZ)Z+0
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(Z)Z+12
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly()V+92
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(I)V+41
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(IZ)V+2
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(ILjavax/imageio/ImageReadParam;Z)Ljava/awt/image/Raster;+3
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.read(ILjavax/imageio/ImageReadParam;)Ljava/awt/image/BufferedImage;+15
j  javax.imageio.ImageIO.read(Ljavax/imageio/stream/ImageInputStream;)Ljava/awt/image/BufferedImage;+55
j  javax.imageio.ImageIO.read(Ljava/io/InputStream;)Ljava/awt/image/BufferedImage;+20
...(snip)..

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.java2d.cmm.lcms.LCMS.createNativeTransform([JIIILjava/lang/Object;)J+0
j  sun.java2d.cmm.lcms.LCMSTransform.doTransform(Lsun/java2d/cmm/lcms/LCMSImageLayout;Lsun/java2d/cmm/lcms/LCMSImageLayout;)V+88
j  sun.java2d.cmm.lcms.LCMSTransform.colorConvert([S[S)[S+92
j  java.awt.color.ICC_ColorSpace.fromRGB([F)[F+119
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.setImageData(IIIII[B)V+158
v  ~StubRoutines::call_stub
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(JZZ)Z+0
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(Z)Z+12
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly()V+92
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(I)V+41
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(IZ)V+2
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(ILjavax/imageio/ImageReadParam;Z)Ljava/awt/image/Raster;+3
j  com.sun.imageio.plugins.jpeg.JPEGImageReader.read(ILjavax/imageio/ImageReadParam;)Ljava/awt/image/BufferedImage;+15
j  javax.imageio.ImageIO.read(Ljavax/imageio/stream/ImageInputStream;)Ljava/awt/image/BufferedImage;+55
j  javax.imageio.ImageIO.read(Ljava/io/InputStream;)Ljava/awt/image/BufferedImage;+20
...(snip)..

Resolution

Upgrade to the latest OpenJDK 7 package, java-1.7.0-openjdk-1.7.0.111 onwars. Run the following as root:

# yum upgrade java-1.7.0-openjdk

This issue was reported in the internal This content is not included.BZ#1142587 and fixed in java-1.7.0-openjdk-1.7.0.111 as part of RHSA-2016:1504.

OpenJDK 7 u111 comes with IcedTea 2.6.7 as noted in Content from blog.fuseyism.com is not included.this page. IcedTea 2.6.7 included many LCMS backports, bringing the code into line with the versions in OpenJDK 8:

S7043064, PR3020: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
S7051394, PR3020: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
S7124245, PR3020: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
S8005402, PR3020: Need to provide benchmarks for color management
S8005530, PR3020: [lcms] Improve performance of ColorConverOp for default destinations
S8005930, PR3020: [lcms] ColorConvertOp: Alpha channel is not transferred from source to destination.
S8013430, PR3020: REGRESSION: closed/java/awt/color/ICC_Profile/LoadProfileTest/LoadProfileTest.java fails with java.io.StreamCorruptedException: invalid type code: EE since 8b87
S8024511, PR3020: Crash during color profile destruction
S8025429, PR3020: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
S8026702, PR3020: Fix for 8025429 breaks jdk build on windows
S8026780, PR3020, RH1142587: Crash on PPC and PPC v2 for Java_awt test suit
S8047066, PR3020: Test test/sun/awt/image/bug8038000.java fails with ClassCastException

Root Cause

Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.