Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8022640

ServiceRegistry (used by ImageIO) lack synchronization

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 6.0, 7u25, 8u60, 9
    • client-libs
    • b107
    • os_x, windows

    Description

      FULL PRODUCT VERSION :
      java version "1.7.0_25"
      Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Platform-independent

      A DESCRIPTION OF THE PROBLEM :
      The javax.imageio.spi.ServiceRegistry javadoc does not mention whether it is thread-safe or not. Looking at source code on JDK 7, we see java.util.HashMap fields without any synchronization. We see no synchronization for the IIORegistry static instance used by javax.imageio.ImageIO neither. This may result in ConcurrentModificationException or other exceptions hard to reproduce.

      A possibly related ConcurrentModificationException has been reported by other user here: http://stackoverflow.com/questions/15432462/java-servlets-and-imageio-error

      A possibly related bug may be 8019623. But while IIORegistry uses AppContext.getAppContext() under the hood, it may still needs its own synchronization too.

      REPRODUCIBILITY :
      This bug can be reproduced rarely.

      Attachments

        Activity

          People

            jdv Jayathirth D V
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: