JDK-8214025 : assert(t->singleton()) failed: must be a constant when ScavengeRootsInCode < 2
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-17
  • Updated: 2020-11-24
  • Resolved: 2018-11-21
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.10Fixed 12 b21Fixed
Related Reports
Relates :  
Relates :  
Description
Reproduce reliably with:

make CONF=linux-x86_64-server-fastdebug run-test TEST=gc/logging/TestUnifiedLoggingSwitchStress.java JTREG="VM_OPTIONS=-XX:ScavengeRootsInCode=1"

#
#  Internal Error (/home/zgu/workspace/jdk/src/hotspot/share/opto/phaseX.cpp:691), pid=31734, tid=31748
#  assert(t->singleton()) failed: must be a constant

Comments
Fix Request (11u) This fixes the corner case in C1, and keeps codebases in sync (I see 11.0.11-oracle). I was unable to reproduce it with the new regression test, but it reproduces (and fixes) the gc/logging/TestUnifiedLoggingSwitchStress.java failure originally reported. The patched binary passes tier{1,2}.
23-11-2020

http://cr.openjdk.java.net/~thartmann/8214025/webrev.00/
19-11-2018

The problem is in doCall.cpp: Stack: [0x00007f9d450a7000,0x00007f9d451a8000], sp=0x00007f9d451a42a0, free space=1012k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x19fd0e3] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x183 V [libjvm.so+0x19fe0ef] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x2f V [libjvm.so+0xb9aaea] report_vm_error(char const*, int, char const*, char const*, ...)+0x12a V [libjvm.so+0x16a1e77] PhaseTransform::makecon(Type const*)+0x237 V [libjvm.so+0xca6b3e] Parse::do_call()+0xe5e We try to create a constant for appendix_arg but TypeOopPtr::make_from_constant does not return a singleton because with -XX:ScavengeRootsInCode <= 1, ciObject::should_be_constant() is false: const TypeOopPtr* appendix_arg_type = TypeOopPtr::make_from_constant(appendix_arg); Node* appendix_arg_node = _gvn.makecon(appendix_arg_type); Fix: --- a/src/hotspot/share/opto/doCall.cpp Sun Nov 18 19:45:33 2018 +0100 +++ b/src/hotspot/share/opto/doCall.cpp Mon Nov 19 06:46:09 2018 +0100 @@ -470,7 +470,7 @@ // Push appendix argument (MethodType, CallSite, etc.), if one. if (iter().has_appendix()) { ciObject* appendix_arg = iter().get_appendix(); - const TypeOopPtr* appendix_arg_type = TypeOopPtr::make_from_constant(appendix_arg); + const TypeOopPtr* appendix_arg_type = TypeOopPtr::make_from_constant(appendix_arg, /* require_const= */ true); Node* appendix_arg_node = _gvn.makecon(appendix_arg_type); push(appendix_arg_node); }
19-11-2018

I can reproduce this with the latest JDK 12 sources (hs_err and replay file attached). This also reproduces by doing a simple: java -XX:ScavengeRootsInCode=1 -Xcomp -XX:-TieredCompilation -version ILW = Crash in C2 compiler, with diagnostic flag -XX:ScavengeRootsInCode=1, use default arguments = HLM = P3
19-11-2018

[~zgu], please attach the hs_err file and a link to the failing job when filing bugs in the hotspot component. Thanks.
19-11-2018