Details
-
Bug
-
Resolution: Fixed
-
P3
-
8, 11, 17, 18, 19
-
b14
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8298016 | 17.0.7-oracle | Dmitry Markov | P3 | Resolved | Fixed | b01 |
JDK-8299362 | 17.0.7 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 |
Description
Upgrading OpenJDK to use LittleCMS 2.13.1 I found that the commit
https://github.com/mm2/Little-CMS/commit/ab5029d60d5dc41a414e4acc472d024e3449d36a
was causing one of our "stress" tests to have a native crash inside LittleCMS.
The stress test creates lots of threads updating profiles (internally using cmsReadRawTag/cmswriteRawTag) and then using them so it looked like a threading problem.
I found it to be nothing to do with stress testing nor threading and to be a combination of a JDK mis-use of the LittleCMS APIs exposing a LittleCMS bug which actually causes the crash.
The LittleCMS upstream bug will be dealt with separately but the OpenJDK bug needs to be fixed for this API to work properly regardless of the status of the LittleCMS bug.
ICC_Profile provides an API to update the content of a tag for a profile.
For this the implementation use cmsReadRawTag/cmsWriteRawTag to copiy a profile completely and instantiate a new one.
But this profile is never opened - and the use of the "Raw" APIs means it needs to be per the docs at
https://www.littlecms.com/LittleCMS2.13%20API.pdf which state on p67
Accessing tags as raw data
Those functions allows to read/write directly to the ICC profile any data, without checking anything.
As a rule, mixing Raw with cooked doesn't work, so writing a tag as raw and then reading it as cooked
without serializing does result into an error. If that is what you want, you will need to dump the profile to
memory or disk and then reopen it.
Attachments
Issue Links
- backported by
-
JDK-8298016 ICC_Profile.setData(int, byte[]) invalidates the profile
- Resolved
-
JDK-8299362 ICC_Profile.setData(int, byte[]) invalidates the profile
- Resolved
- duplicates
-
JDK-8272865 Inconsistent code in the LCMS.c#_writeCookedTag
- Closed
-
JDK-8282635 Test sun/java2d/cmm/ReadWriteProfileTest.java has problems
- Closed
- links to
-
Commit openjdk/jdk17u-dev/d8cc8a8e
-
Commit openjdk/jdk/f66070b0
-
Review openjdk/jdk17u-dev/970
-
Review openjdk/jdk/7668
(3 links to)