JDK-8207965 : C2-only debug build fails
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2018-07-20
  • Updated: 2020-04-26
  • Resolved: 2018-08-09
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 12
11.0.5-oracleFixed 12 b07Fixed
Related Reports
Relates :  
Description
Reported by Xin Liu (xxinliu@amazon.com).

The C++ compiler complains attempting to compile aotCodeHeap.cpp with this configuration:

bash ./configure --with-jvm-features=-compiler1 --enable-option-checking=fatal --with-debug-level=fastdebug

results in

/Users/xxinliu/Devel/openjdk/jdk/src/hotspot/share/aot/aotCodeHeap.cpp:711:59: error: no member named 'aot_code' in 'Method'
  vmassert(aot->method()->code() != aot && aot->method()->aot_code() == NULL, "method still active");
                                           ~~~~~~~~~~~~~  ^
/Users/xxinliu/Devel/openjdk/jdk/src/hotspot/share/utilities/debug.hpp:55:9: note: expanded from macro 'vmassert'
  if (!(p)) {                                                                  \
        ^
1 error generated.

A possible patch is:

diff -r 35e64b62b284 src/hotspot/share/aot/aotCodeHeap.cpp
--- a/src/hotspot/share/aot/aotCodeHeap.cpp	Tue Jul 17 17:14:03 2018 -0400
+++ b/src/hotspot/share/aot/aotCodeHeap.cpp	Tue Jul 17 15:51:11 2018 -0700
@@ -708,7 +708,9 @@
 void AOTCodeHeap::sweep_method(AOTCompiledMethod *aot) {
   int indexes[] = {aot->method_index()};
   sweep_dependent_methods(indexes, 1);
+#ifdef TIERED
   vmassert(aot->method()->code() != aot && aot->method()->aot_code() == NULL, "method still active");
+#endif
 }
 
 
diff -r 35e64b62b284 src/hotspot/share/aot/aotCompiledMethod.cpp
--- a/src/hotspot/share/aot/aotCompiledMethod.cpp	Tue Jul 17 17:14:03 2018 -0400
+++ b/src/hotspot/share/aot/aotCompiledMethod.cpp	Tue Jul 17 15:51:11 2018 -0700
@@ -208,8 +208,9 @@
 
 bool AOTCompiledMethod::make_entrant() {
   assert(!method()->is_old(), "reviving evolved method!");
+#ifdef TIERED
   assert(*_state_adr != not_entrant, "%s", method()->has_aot_code() ? "has_aot_code() not cleared" : "caller didn't check has_aot_code()");
-
+#endif
   // Make sure the method is not flushed in case of a safepoint in code below.
   methodHandle the_method(method());
   NoSafepointVerifier nsv;

Comments
Fix Request (11u) Backporting this fixes a build config corner case and matches codebases (I see 11.0.5-oracle). Patch applies to 11u only partially, due to other backports already bringing the pieces of it. 11u RFR: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-August/001741.html
23-08-2019

Final: http://cr.openjdk.java.net/~phh/8207965/webrev.05/
08-08-2018

diff -r d8cd1a8ae50f make/hotspot/src/native/dtrace/generateJvmOffsets.cpp --- a/make/hotspot/src/native/dtrace/generateJvmOffsets.cpp +++ b/make/hotspot/src/native/dtrace/generateJvmOffsets.cpp @@ -40,6 +40,7 @@ #include <proc_service.h> #include "gc/shared/collectedHeap.hpp" +#include "memory/heap.hpp" #include "runtime/vmStructs.hpp" typedef enum GEN_variant { diff -r 13e2e64337be test/hotspot/jtreg/compiler/runtime/Test6859338.java --- a/test/hotspot/jtreg/compiler/runtime/Test6859338.java +++ b/test/hotspot/jtreg/compiler/runtime/Test6859338.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @bug 6859338 * @summary Assertion failure in sharedRuntime.cpp * + * @requires vm.compiler1.enabled | !vm.graal.enabled * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions * -XX:-InlineObjectHash -Xbatch -XX:-ProfileInterpreter * compiler.runtime.Test6859338 diff -r 13e2e64337be test/hotspot/jtreg/compiler/whitebox/BlockingCompilation.java --- a/test/hotspot/jtreg/compiler/whitebox/BlockingCompilation.java +++ b/test/hotspot/jtreg/compiler/whitebox/BlockingCompilation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 SAP SE. All rights reserved. + * Copyright (c) 2016, 2018, SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 8150646 8153013 * @summary Add support for blocking compiles through whitebox API + * @requires vm.compiler1.enabled | !vm.graal.enabled * @modules java.base/jdk.internal.misc * @library /test/lib / * @build sun.hotspot.WhiteBox diff -r d8cd1a8ae50f test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java --- a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java +++ b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ * * @build sun.hotspot.WhiteBox * @requires !(vm.cpu.features ~= ".*aes.*") + * @requires vm.compiler1.enabled | !vm.graal.enabled * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
08-08-2018

Testing for webrev.04 with additional changes I made passed with known unrelated failures.
08-08-2018

http://cr.openjdk.java.net/~phh/8207965/webrev.04/
08-08-2018

http://cr.openjdk.java.net/~phh/8207965/webrev.02/
03-08-2018

http://cr.openjdk.java.net/~phh/8207965/webrev.01/
31-07-2018