[Email in lieu of a known working Jira]

Since the JAI-EXT merge, gt-coverage ImageWorkerTest.testYCbCr on master fails when using LCMS 2.6.

LCMS (Little CMS) is the native PCMS implementation used by the JVM on Linux, implemented in liblcms2.so.2 and provided on Debian and Ubuntu by the package liblcms2-2.

ImageWorkerTest.testYCbCr passes with LCMS 2.2, as found in Ubuntu 12.04 LTS (precise) on Travis CI. The test also works fine with LCMS 2.2 from debian/wheezy.

ImageWorkerTest.testYCbCr fails with LCMS 2.6 on debian/sid (liblcms2-2:amd64 2.6-3+b3). I also expect it to fail with current Ubuntu stable 14.10 (utopic) or later as these use LCMS 2.6:
https://launchpad.net/ubuntu/+source/lcms2

On debian/sid amd64 I can prove that LCMS 2.6 is the cause by unpacking liblcms2 2.2 from wheezy:
http://ftp.us.debian.org/debian/pool/main/l/lcms2/liblcms2-2_2.2+git20110628-2.2+deb7u1_amd64.deb

and using LD_LIBRARY_PATH to cause the JVM to load it, as follows (in bash):

mkdir -p /tmp/lcms
dpkg -x liblcms2-2_2.2+git20110628-2.2+deb7u1_amd64.deb /tmp/lcms
export LD_LIBRARY_PATH=/tmp/lcms/usr/lib/x86_64-linux-gnu
# then in a previously built modules/library/coverage
mvn -o -Dtest='ImageWorkerTest#testYCbCr' test

The test then passes. To make it fail, "unset LD_LIBRARY_PATH" and re-run the mvn command.

You should be able to use the same technique to reproduce this failure on Ubuntu 12.10 LTS (precise) by unpacking the liblcms2 deb from Ubuntu 14.10 (utopic). I have not tested it on Ubuntu (but used the Ubuntu .so under Debian and it also caused the test to fail):
https://launchpad.net/ubuntu/+source/lcms2/2.6-3ubuntu1/+build/6123210/+files/liblcms2-2_2.6-3ubuntu1_amd64.deb

Here is the .deb LCMS 2.6 for debian/sid:
http://ftp.us.debian.org/debian/pool/main/l/lcms2/liblcms2-2_2.6-3+b3_amd64.deb

I have attached the output of a failing maven test run. Note the NPE at factory load time before the test. This is caused by the underlying problem.

The same behaviour can be seen in Eclipse by running ImageWorkerTest.testYCbCr alone. Of interest are lines 1375 and 1377 in ICC_Profile (put breakpoints on those lines). The 18th invocation of mdl.getTagData at line 1375 (a call to LCSM native code) throws CMMException with "ICC Profile header not found" and tagData is set to null, which causes the later NPE.

Checking out c4b60bea20c048f654f3275ae182202ad51d2e68 (just before the JAI-EXT merge) makes the build pass. Furthermore, the ICC_Profile methods are not even entered in that version. This suggests to me that the problem with LCSM 2.6 is related to the JAI-EXT merge. I am not going to assign blame as it looks like it might be a regression in LCMS. :-)

For the record, I am using this platform (pretty much the same as Travis CI openjdk7):
$ mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15T06:29:23+13:00)
Maven home: /home/ben/java/maven
Java version: 1.7.0_75, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-4-amd64", arch: "amd64", family: "unix"

Kind regards,

--
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <http://transient.nz>
New Zealand
[WARNING] Disabling enhanced local repository: using legacy is strongly discouraged to ensure build reproducibility.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.geotools:gt-coverage:jar:14-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ org.geotools:geotools:14-SNAPSHOT, /home/ben/geoserver/src with spaces/geotools/pom.xml, line 1456, column 15
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Grid Coverage module 14-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- git-commit-id-plugin:2.1.2:revision (default) @ gt-coverage ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gt-coverage ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ gt-coverage ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ gt-coverage ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ gt-coverage ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.15:test (default-test) @ gt-coverage ---
[INFO] Surefire report directory: /home/ben/geoserver/src with spaces/geotools/modules/library/coverage/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.geotools.image.ImageWorkerTest
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/affine/jt-affine/1.0.1/jt-affine-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Affine" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/scale/jt-scale/1.0.1/jt-scale-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Scale" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/translate/jt-translate/1.0.1/jt-translate-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Translate" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/bandmerge/jt-bandmerge/1.0.1/jt-bandmerge-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "BandMerge" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/bandselect/jt-bandselect/1.0.1/jt-bandselect-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "BandSelect" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/border/jt-border/1.0.1/jt-border-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Border" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/crop/jt-crop/1.0.1/jt-crop-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Crop" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/lookup/jt-lookup/1.0.1/jt-lookup-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Lookup" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/mosaic/jt-mosaic/1.0.1/jt-mosaic-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Mosaic" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/nullop/jt-nullop/1.0.1/jt-nullop-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Null" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/rescale/jt-rescale/1.0.1/jt-rescale-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Rescale" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/warp/jt-warp/1.0.1/jt-warp-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Warp" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/binarize/jt-binarize/1.0.1/jt-binarize-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Binarize" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/format/jt-format/1.0.1/jt-format-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "Format" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/colorconvert/jt-colorconvert/1.0.1/jt-colorconvert-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "ColorConvert" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/errordiffusion/jt-errordiffusion/1.0.1/jt-errordiffusion-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "ErrorDiffusion" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/orderdither/jt-orderdither/1.0.1/jt-orderdither-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "OrderedDither" under registry mode "rendered"
Error while parsing JAI registry file "file:/home/ben/.m2/repository/it/geosolutions/jaiext/imagefunction/jt-imagefunction/1.0.1/jt-imagefunction-1.0.1.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #5
A descriptor is already registered against the name "ImageFunction" under registry mode "rendered"
Apr 11, 2015 12:36:12 PM org.geotools.image.ImageWorker <clinit>
INFO: Warp/affine reduction enabled: true
Apr 11, 2015 12:36:13 PM org.geotools.util.logging.LoggingImagingListener errorOccurred
INFO: One factory fails for the operation "ColorConvert"
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
	at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
	at it.geosolutions.jaiext.ConcurrentOperationRegistry.invokeFactory(ConcurrentOperationRegistry.java:565)
	at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
	at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
	at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
	at javax.media.jai.RenderedOp.getColorModel(RenderedOp.java:2242)
	at org.geotools.image.ImageWorker.isColorSpaceRGB(ImageWorker.java:1186)
	at org.geotools.image.ImageWorker.forceColorSpaceRGB(ImageWorker.java:1821)
	at org.geotools.image.ImageWorkerTest.testYCbCr(ImageWorkerTest.java:946)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	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:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:254)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:149)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.NullPointerException
	at java.awt.color.ICC_Profile.intFromBigEndian(ICC_Profile.java:1770)
	at java.awt.color.ICC_Profile.getNumComponents(ICC_Profile.java:1462)
	at sun.java2d.cmm.lcms.LCMSTransform.<init>(LCMSTransform.java:96)
	at sun.java2d.cmm.lcms.LCMS.createTransform(LCMS.java:66)
	at java.awt.color.ICC_ColorSpace.toCIEXYZ(ICC_ColorSpace.java:354)
	at it.geosolutions.jaiext.colorconvert.ColorConvertOpImage.<init>(ColorConvertOpImage.java:328)
	at it.geosolutions.jaiext.colorconvert.ColorConvertCRIF.create(ColorConvertCRIF.java:66)
	... 38 more

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.683 sec <<< FAILURE! - in org.geotools.image.ImageWorkerTest
testYCbCr(org.geotools.image.ImageWorkerTest)  Time elapsed: 0.615 sec  <<< ERROR!
javax.media.jai.util.ImagingException: All factories fail for the operation "ColorConvert"
	at java.awt.color.ICC_Profile.intFromBigEndian(ICC_Profile.java:1770)
	at java.awt.color.ICC_Profile.getNumComponents(ICC_Profile.java:1462)
	at sun.java2d.cmm.lcms.LCMSTransform.<init>(LCMSTransform.java:96)
	at sun.java2d.cmm.lcms.LCMS.createTransform(LCMS.java:66)
	at java.awt.color.ICC_ColorSpace.toCIEXYZ(ICC_ColorSpace.java:354)
	at it.geosolutions.jaiext.colorconvert.ColorConvertOpImage.<init>(ColorConvertOpImage.java:328)
	at it.geosolutions.jaiext.colorconvert.ColorConvertCRIF.create(ColorConvertCRIF.java:66)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
	at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
	at it.geosolutions.jaiext.ConcurrentOperationRegistry.invokeFactory(ConcurrentOperationRegistry.java:565)
	at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
	at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
	at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
	at javax.media.jai.RenderedOp.getColorModel(RenderedOp.java:2242)
	at org.geotools.image.ImageWorker.isColorSpaceRGB(ImageWorker.java:1186)
	at org.geotools.image.ImageWorker.forceColorSpaceRGB(ImageWorker.java:1821)
	at org.geotools.image.ImageWorkerTest.testYCbCr(ImageWorkerTest.java:946)


Results :

Tests in error: 
  ImageWorkerTest.testYCbCr:946 » Imaging All factories fail for the operation "...

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.397 s
[INFO] Finished at: 2015-04-11T12:36:13+12:00
[INFO] Final Memory: 20M/215M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test (default-test) on project gt-coverage: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/ben/geoserver/src with spaces/geotools/modules/library/coverage/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to