This is a multi-threading problem with LCMS version 2.5. It was claimed to have been fixed with LCMS v2.6, but many OS are still running the older packages. I have code that parses PDF files. It is running in a production environment on random PDF files and with lots of threads. I was able to stop the error (~2 years ago) by adding "syncronized" keyword around the following block of java code:
ICC_Profile profile = ICC_Profile.getInstance(byte[]);
ICC_ColorSpace colorSpace = new ICC_ColorSpace(profile);
int numComponents = 3; // From PDF dictionary, typically '3' (RGB).
float[] components = new float[numComponents];
// Test that ICC_Profile can be parsed
// Generates an exception on malformed byte[]
// Crashes JVM sporadically if not forced inline by 'syncronized'
new java.awt.Color(colorSpace,components,1f);
If it helps, here's my java method (won't compile as it is missing methods):
public static synchronized PDFColorSpace getICCColorSpace(PDFToken dict) throws IOException {
PDFColorSpace cs=null;
PDFToken nToken = dict.getDictionaryItem(N);
int numComponents = (nToken==null) ? 1 : nToken.getInteger();
This is a multi-threading problem with LCMS version 2.5. It was claimed to have been fixed with LCMS v2.6, but many OS are still running the older packages. I have code that parses PDF files. It is running in a production environment on random PDF files and with lots of threads. I was able to stop the error (~2 years ago) by adding "syncronized" keyword around the following block of java code: getInstance( byte[]) ; profile) ; ents];
ICC_Profile profile = ICC_Profile.
ICC_ColorSpace colorSpace = new ICC_ColorSpace(
int numComponents = 3; // From PDF dictionary, typically '3' (RGB).
float[] components = new float[numCompon
// Test that ICC_Profile can be parsed Color(colorSpac e,components, 1f);
// Generates an exception on malformed byte[]
// Crashes JVM sporadically if not forced inline by 'syncronized'
new java.awt.
If it helps, here's my java method (won't compile as it is missing methods): e(PDFToken dict) throws IOException { aryItem( N); getInteger( );
public static synchronized PDFColorSpace getICCColorSpac
PDFColorSpace cs=null;
PDFToken nToken = dict.getDiction
int numComponents = (nToken==null) ? 1 : nToken.
try {
ICC_Profile profile = ICC_Profile. getInstance( dict.getStream( ).toString8( ).getBytes( ));
// This does not prevent JVM Crash with BELL.SW getNumComponent s() == numComponents) ...
// if (profile.
ICC_ColorSpace colorSpace = new ICC_ColorSpace( profile) ; e(TypeICC, colorSpace) ;
cs = new NativeColorSpac
// Test if ICC_Profile is OK. Will throw Exception (or even crash the JVM) www.siemens. com/investor/ pool/de/ investor_ relations/ events/ hauptversammlun g/2012/ dividendenbekan ntmachung. pdf, pg0 ents]; Color(colorSpac e,components, 1f);
// eg: Cik#99001898, http://
// eg: JVM Crash, Cik#99002137, BELL.SW
float[] components = new float[numCompon
new java.awt.
} catch (Exception e) {
cs=null;
}
return cs;
}