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

AddToBootstrapClassLoaderSearch replaces jdk.boot.class.path.append value set by SetSystemProperty

XMLWordPrintable

      A variant of this was reported by the ZeroTurnaround folks on jigsaw-dev.

      The system property jdk.boot.class.path.append can be set/changed by:

      1. -Xbootclasspath/a
      2. An agent changing the value of the property in Agent_OnLoad
      3. AddToBootstrapClassLoaderSearch

      If we have all three, in this sequence, then the AddToBootstrapClassLoaderSearch property value set in #2 will be replaced. This needs to be investigated as there is potential corruption going on too, at least this is what has been suggested on the jigsaw-dev list.

      The attached agent is one test case to demonstrate things, consider this:

      java -Xbootclasspath/a:boot -agentlib:agent Test

      The value printed should be boot:mydir:foo.jar but it actually prints boot:foo.jar.

      Now change agent.c to comment out the usage of AddToBootstrapClassLoaderSearch, the test will correctly print boot:mydir.

        1. agent.c
          1 kB
          Alan Bateman
        2. Test.java
          0.2 kB
          Alan Bateman

            lfoltan Lois Foltan
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: