JDK-6511593 : REG: Doing color conversions on multiple threads throws exceptions, crashes the VM intermittently
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-01-10
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u2Fixed 7 b14Fixed
Description
Calling ColorConvertOp.filter from multiple threads throws various exceptions and sporadically crashes the VM. In my code, I am creating a new ColorConvertOp instance for every thread with different color spaces. The crash/exception appears to be in the CMM library. This is reproducible only on Win32 and not reproducible on SolSparc10. This is reproducible on JDK6 as well as JDK7 and Not reproducible on Tiger-FCS. 

I regressed using various mustang builds and it started appearing only in b92. Hence it is a regression in Mustang.

Here is the exception:
java.awt.color.CMMException: Invlaid transform
at sun.awt.color.CMM.checkStatus(CMM.java:127)
at sun.awt.color.ICC_Transform.colorConvert(ICC_Transform.java:847)
at java.awt.image.ColorModel.getLinearGray16ToOtherGray8LUT(ColorModel.java:1841)
at java.awt.image.ComponentColorModel.setupLUTs(ComponentColorModel.java:431)
at java.awt.image.ComponentColorModel.<init>(ComponentColorModel.java:282)
at java.awt.image.ColorConvertOp.createCompatibleDestImage(ColorConvertOp.java:631)

I have attached a sample test. Execute the sample test and you would see various exceptions and sometimes a crash on Win32 platform. I have attached the crash logs to this bug report.

Comments
EVALUATION Fixed by adding synchronization around CMM.cmmColorConvert calls. Synchronisation is added on per color transform instance.
16-03-2007

EVALUATION Looks like there is a problem with internal synchronization on native data within Kodak color management library. Adding synchronization into colorConvert methods of the ICC_Transform class solves the problem.
18-01-2007