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

HashMap initialization problem with SecurityManager installed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7u6
    • Fix Version/s: tbd_minor
    • Component/s: core-libs
    • Labels:
    • Environment:

      rmid with seucrity manager

      Description

      As reported by Thomas Salter:

      http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012113.html

      When running rmid (sun.rmi.server.Activation) with a security manager the order of class initialization results in

      Here's a synopsis of what [Thomas] thinks is happening:
      1. AccessControllerContext at 98 caused Policy.isset.
      2. Before calling isSet, the class loader initialize Policy by calling <clinit>
      3. Clinit found its way into HashMap init.
      4. HashMap init called HashMap$Holder.<clinit>
      5. Which called AccessController
      6. Which eventually called isSet. Policy was already loaded and its clinit called, so isSet actually got called.
      7. But Policy.<clinit> had not completed so policy is null, hence NPE.
      8. The class loader from #2 caught the exception and wrapped it in the ExceptionInitializationError.

        Attachments

          Activity

            People

            Assignee:
            mduigou Mike Duigou
            Reporter:
            mduigou Mike Duigou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: