JDK-6986863 : ProfileDeferralMgr throwing ConcurrentModificationException
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-09-22
  • Updated: 2022-03-30
  • Resolved: 2021-01-29
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 11 JDK 17
11.0.16-oracleFixed 17 b08Fixed
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux Ubuntu-1004-lucid-64-minimal 2.6.32-23-server #37-Ubuntu SMP Fri Jun 11 09:11:11 UTC 2010 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
The following code:

        BufferedImage image = null;
        try {
            image = ImageIO.read(imageUrl);
        } catch (Exception e) {
            log.error("Unable to read image file: " + fileName);
            e.printStackTrace();
        }

occasionally throws an exception out of the blue:

2010-09-22 19:48:51,596 ERROR [com.mypackage.Renderer] (pool-23-thread-1) Unable to read image file: /image.jpg
2010-09-22 19:48:51,596 ERROR [STDERR] (pool-23-thread-1) java.util.ConcurrentModificationException
2010-09-22 19:48:51,596 ERROR [STDERR] (pool-23-thread-1) 	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at java.util.AbstractList$Itr.next(AbstractList.java:343)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at sun.awt.color.ProfileDeferralMgr.activateProfiles(ProfileDeferralMgr.java:75)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:756)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.sun.imageio.plugins.jpeg.JPEGImageReader.setImageData(JPEGImageReader.java:565)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:517)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:272)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:394)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:510)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:913)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:897)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at javax.imageio.ImageIO.read(ImageIO.java:1422)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at javax.imageio.ImageIO.read(ImageIO.java:1374)
2010-09-22 19:48:51,597 ERROR [STDERR] (pool-23-thread-1) 	at com.mypackage.Renderer.readImage(Renderer.java:121)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Cannot reproduce it on second Ubuntu 32bit machine.

Behaviour seems to be less frequent when I run the JVM with less (!) memory in -Xmx

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Load the buffered image (same code works fine many times, but not always)
ACTUAL -
Exception is thrown from deep below

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.util.ConcurrentModificationException


REPRODUCIBILITY :
This bug can be reproduced often.

Comments
Fix request (11u) This change prevents intermittent exceptions in the applications and tests caused by the weak synchronization of the color profiles loading. PR: https://github.com/openjdk/jdk11u-dev/pull/834
15-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/834 Date: 2022-02-19 04:20:24 +0000
21-02-2022

This issue may cause random/rare test failures on jdk8 and jdk11 such as: java.lang.NullPointerException at java.awt.color.ICC_Profile.activateDeferredProfile at java.awt.color.ICC_Profile$1.activate at sun.java2d.cmm.ProfileDeferralMgr.activateProfiles at java.awt.color.ICC_Profile.getInstance at java.awt.color.ICC_Profile.getInstance at javasoft.sqe.tests.api.java.awt.Color.ICC_Profile.GetTest.testCase6
25-01-2022

Changeset: 64a150c5 Author: Sergey Bylokhov <serb@openjdk.org> Date: 2021-01-29 06:18:43 +0000 URL: https://git.openjdk.java.net/jdk/commit/64a150c5
29-01-2021

Regression of JDK-6793818
13-11-2020

I created another version of the fix as part of JDK-8254737
13-11-2020

This is SFAIK, still a problem.
06-05-2014

We don't have plans to fix it
06-05-2014