JDK-8146660 : Resolve merge issue in resulting from sun.misc.VM move to jdk.internal.misc
  • Type: Bug
  • Component: core-libs
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-01-08
  • Updated: 2017-05-03
  • Resolved: 2016-01-14
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 9
9 b103Fixed
Related Reports
Relates :  
Description
Looks like the fix for subtask JDK-8145544 missed some classes in the hotspot repo
and so the build is broken when merging jdk9/dev with jdk9/hs:

=== Output from failing command(s) repeated here ===
/usr/bin/printf "* For target jdk.vm.ci:\n" 
* For target jdk.vm.ci:
/bin/cat /opt/jprt/T/P1/022206.amurillo/s/build/macosx-x86_64-normal-server-fastdebug/make-support/failure-logs/jdk.vm.ci.log | /usr/bin/grep -v -e "^Note: including file:" 
/opt/jprt/T/P1/022206.amurillo/s/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java:52: error: cannot find symbol
import sun.misc.VM;
               ^
  symbol:   class VM
  location: package sun.misc
/opt/jprt/T/P1/022206.amurillo/s/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java:96: error: cannot find symbol
        String value = VM.getSavedProperty("jvmci." + name);
                       ^
  symbol:   variable VM
  location: class HotSpotJVMCIRuntime
2 errors
/usr/bin/printf "=== End of repeated output ===\n" 

We need this fixed ASAP as this is preventing the creation of jdk9/hs snapshots for integrating into jdk9/dev (we run PIT over the weekend)
Comments
This issue is verified due to the tests in closed/com/oracle/jfr/event/gc/stacktrace pass.
03-05-2017

That worked Erik for the manual build. Just submitted jprt jobs to double check. Here are the changes I plan to push using Erik, Chris T and Chris H as reviewers. If I don't hear from anyone I will assume you guys are ok with that (I need to push that asap): [/export/home/amurillo/mydev/8146660-vm-ci/jdk9-hs-2016-01-11-snap]: diff -r 7847205df7f7 make/Main.gmk --- a/make/Main.gmk Tue Jan 12 11:31:47 2016 -0800 +++ b/make/Main.gmk Wed Jan 13 10:45:20 2016 -0800 @@ -427,6 +427,10 @@ # in javadoc. java.desktop-gensrc-jdk: java.base-gensrc + # The annotation processing for jdk.vm.ci needs java.base classes from the + # current JDK. + jdk.vm.ci-gensrc-hotspot: java.base-java + # Explicitly add dependencies for special targets java.base-java: unpack-sec diff -r 7847205df7f7 modules.xml --- a/modules.xml Tue Jan 12 11:31:47 2016 -0800 +++ b/modules.xml Wed Jan 13 10:45:20 2016 -0800 @@ -237,6 +237,7 @@ <to>jdk.charsets</to> <to>jdk.management.resource</to> <to>jdk.scripting.nashorn</to> + <to>jdk.vm.ci</to> </export> <export> <name>jdk.internal.org.objectweb.asm</name> [/export/home/amurillo/mydev/8146660-vm-ci/jdk9-hs-2016-01-11-snap/hotspot]: diff -r 6f9765435e74 make/gensrc/Gensrc-jdk.vm.ci.gmk --- a/make/gensrc/Gensrc-jdk.vm.ci.gmk Tue Jan 12 11:31:47 2016 -0800 +++ b/make/gensrc/Gensrc-jdk.vm.ci.gmk Wed Jan 13 10:45:20 2016 -0800 @@ -69,6 +69,7 @@ $(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files)) $(JAVA_SMALL) $(NEW_JAVAC) \ -XDignore.symbol.file \ + -bootclasspath $(JDK_OUTPUTDIR)/modules/java.base \ -sourcepath $(SOURCEPATH) \ -implicit:none \ -proc:only \ diff -r 6f9765435e74 src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java --- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java Tue Jan 12 11:31:47 2016 -0800 +++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java Wed Jan 13 10:45:20 2016 -0800 @@ -49,7 +49,7 @@ import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.service.Services; -import sun.misc.VM; +import jdk.internal.misc.VM; //JaCoCo Exclude
13-01-2016

Oh, I just realized my patch was wrong. It should read: jdk.vm.ci-gensrc-hotspot: java.base-java sorry about that.
13-01-2016

Makes sense.
12-01-2016

Ok, I think I understand the relationship better now and it's not nasty. If this will indeed become a common pattern, then we will need to figure something out. As things stand now, there are only three gensrc targets that have dependencies on anything but buildtools targets, so explicitly adding them is still preferable to me.
12-01-2016

I don't think it's nasty. This is to be expected and might come up more in the future. If we process some JDK code with a processor the code to be processed needs to be compiled with javac. In this example jdk.vm.ci depends on java.base so jdk.vm.ci needs to be compiled with that dependency on the boot class path. Doing annotation processing is not different than actually compiling the code. Frankly, what I would like to see is a more general way of introducing that dependency for gensrc targets.
12-01-2016

That's a pretty nasty dependency and would be good if we could find a solution without. For now, to get that enforced, this is the patch you need: diff -r 4b01ea6c12c3 make/Main.gmk --- a/make/Main.gmk +++ b/make/Main.gmk @@ -427,6 +427,10 @@ # in javadoc. java.desktop-gensrc-jdk: java.base-gensrc + # The annotation processing for jdk.vm.ci needs java.base classes from the + # current JDK. + jdk.vm.ci-gensrc: java.base-java + # Explicitly add dependencies for special targets java.base-java: unpack-sec
12-01-2016

Annotation processing for jdk.vm.ci now depends on java.base from a JDK 9. The Makefile change is pretty simple: diff -r 95f7632b030b make/gensrc/Gensrc-jdk.vm.ci.gmk --- a/make/gensrc/Gensrc-jdk.vm.ci.gmk Wed Jan 06 08:02:23 2016 +0100 +++ b/make/gensrc/Gensrc-jdk.vm.ci.gmk Fri Jan 08 10:52:48 2016 -1000 @@ -69,6 +69,7 @@ PROCESSOR_PATH := $(call PathList, \ $(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files)) $(JAVA_SMALL) $(NEW_JAVAC) \ -XDignore.symbol.file \ + -bootclasspath $(JDK_OUTPUTDIR)/modules/java.base \ -sourcepath $(SOURCEPATH) \ -implicit:none \ -proc:only \ but I don't know how I can add a dependency to java.base for jdk.vm.ci-gensrc. [~aeriksso]? [~ihse]?
08-01-2016

Modifying the import statement wasn't enough, some other changes are required to fix the dependencies, I discussed this with Chris, so I'm assigning this to him, as he has a solution but need some input from the build folks.
08-01-2016

Sounds good, I will take care of that Thanks Chris
08-01-2016

Looks like a recent changes in the hotspot forest introduced a new dependency on sun.misc.VM, which is not in jdk9/dev where the renaming occurred. http://hg.openjdk.java.net/jdk9/hs/hotspot/comparison/2794bc7859f5/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java To resolve this issue a simple change required in HotSpotJVMCIRuntime.java: < import sun.misc.VM; --- < import jdk.internal.misc.VM; The change cannot happen directly in either jdk9/dev or jdk9/hs, since neither forest contains the required set changes. The change should happen in either one of a Merge changeset, or a changeset created with this bugID, 8146660, in Alejandro's merged staging forest.
08-01-2016