JDK-8206931 : Misleading "COMPILE SKIPPED: invalid non-klass dependency" compile log
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-07-09
  • Updated: 2019-09-19
  • Resolved: 2018-07-11
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
11Fixed 12 b02Fixed
Related Reports
Relates :  
Relates :  
Description
I have been following up on some weird compilation skips with Shenandoah, and figured we have the intermittent skip like this:

 8376  711   !         java.io.ObjectInputStream::readSerialData (563 bytes)   COMPILE SKIPPED: invalid non-klass dependency

But then, printing out the actual dependency that failed yields:

 8376  711   !         java.io.ObjectInputStream::readSerialData (563 bytes)   COMPILE SKIPPED: invalid non-klass dependency: leaf_type

But leaf_type *is* klass dependency! I think the condition in the logging code is incorrect, and this is actually "concurrent class unloading". This must be the fix:

diff -r 266e6a543eaa src/hotspot/share/ci/ciEnv.cpp
--- a/src/hotspot/share/ci/ciEnv.cpp	Mon Jul 09 10:35:29 2018 +0200
+++ b/src/hotspot/share/ci/ciEnv.cpp	Mon Jul 09 19:46:56 2018 +0200
@@ -935,12 +935,12 @@
   Dependencies::DepType result = dependencies()->validate_dependencies(_task, counter_changed);
   if (result != Dependencies::end_marker) {
     if (result == Dependencies::call_site_target_value) {
       _inc_decompile_count_on_failure = false;
       record_failure("call site target change");
-    } else if (Dependencies::is_klass_type(result)) {
-      record_failure("invalid non-klass dependency");
+    } else if (!Dependencies::is_klass_type(result)) {
+      record_failure(err_msg("invalid non-klass dependency: %s", Dependencies::dep_name(result)));
     } else {
       record_failure("concurrent class loading");
     }
   }
 }

Would be nice if somebody double-check it.
Comments
I think this should be back ported into JDK 11 too.
11-07-2018

Testing passed only with one known failure.
10-07-2018

http://cr.openjdk.java.net/~shade/8206931/webrev.03/
10-07-2018

RFR: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2018-July/029737.html
10-07-2018

Yes, it looks like typo. [~never] Tom? Original code was next. It skips klass type: - if (deps.is_klass_type()) continue; // skip klass dependencies - Klass* witness = deps.check_dependency(); - if (witness != NULL) { - if (deps.type() == Dependencies::call_site_target_value) { - _inc_decompile_count_on_failure = false; - record_failure("call site target change"); - } else { - record_failure("invalid non-klass dependency");
10-07-2018

Seems to be introduced by JDK-8191052.
10-07-2018

ILW = wrong information output in compiler log, misleading; only diagnostics issue with compile skip, always; none = MMH = P3
10-07-2018