United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7042594 : 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.

Details
Type:
Bug
Submit Date:
2011-05-06
Status:
Closed
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2011-06-30
Component:
client-libs
OS:
linux_oracle_6.0
Sub-Component:
2d
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Relates:
Relates:

Sub Tasks

Description
Tests 

api/java_awt/Color/ICC_ProfileRGB/index.html#GetTesttestCase17[testCase17]		api/java_awt/Color/ICC_ProfileRGB/index.html#GetTesttestCase2[testCase2]		api/java_awt/Color/ICC_ProfileRGB/index.html#SetDataTesttestCase1[testCase1]		


fail against Open JDK 7 b138 on OEL 6 x64 with message

java.awt.color.CMMException: Can not write tag data.

                                    

Comments
EVALUATION

>java.awt.color.CMMException: Can not write tag data.
>        at sun.java2d.cmm.lcms.LCMS.setTagData(Native Method)
>        at java.awt.color.ICC_Profile.setData(ICC_Profile.java:1400)

This is the same problem as the regression test failures reported in
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
                                     
2011-05-09
EVALUATION

Note that all failed test cases use the same pattern: they set incorrect data as a content of MAB curve:

GetTest.java
testCase17():
            byte[] headData = new byte[10];
            for(int i = 0;i < headData.length;i++)
                headData[i] = (byte)i;
            profile.setData(ICC_ProfileRGB.icSigAToB0Tag, headData);
 
testCase2():
             byte[] headData = new byte[10];
             for(int i = 0;i < headData.length;i++)
                headData[i] = (byte)i;
            profile.setData(ICC_ProfileRGB.icSigAToB0Tag, headData);


SetDataTest.java:
testCase1():
            byte[] headData = new byte[10];
            for(int i = 0;i < headData.length;i++)
                headData[i] = (byte)i;
            profile.setData(ICC_ProfileRGB.icSigAToB0Tag, headData);

This approach works for kcms, because kcms does not validate tag data, and silently
accepts any binary data as a tag content. In contrast, lcms always validates user supplied
data, and reject injection of malformed tag content.

I am not sure what in particular these test are supposed to verify, but, they should probably
operate with correct tag data here.
                                     
2011-05-10
EVALUATION

6-open did not have this problem because we used a modified version
of Little CMS 1.X. Little CMS 2.0 now supports setting tag data but
does validation that KCMS does not.

That validation by LittleCMS is reasonable and I presume was not observed
by any of our tests when we integrated LittleCMS into 7 because those
tests use validate data, whereas JCK uses incorrect data.

In the implementation of ICC_Profile.java it can be seen that it
was always possible that CMMException ( a subclass of RuntimeException)
might be thrown but since KCMS never checked the data it did not.

So what needs to be done here is
1. We document CMMException and the conditions under which it might be thrown
2. The failing test needs to be updated or excluded.
                                     
2011-05-20
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/java2d_data/7/7042594.3
                                     
2011-06-04



Hardware and Software, Engineered to Work Together