JDK-8287091 : aarch64 : guarantee(val < (1ULL << nbits)) failed: Field too big for insn
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17.0.5-oracle,19
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: aarch64
  • Submitted: 2022-05-20
  • Updated: 2022-08-02
  • Resolved: 2022-05-25
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 17 JDK 19
11.0.18-oracleFixed 17.0.5-oracleFixed 19 b24Fixed
Related Reports
Relates :  
Relates :  
Description
Since ~ 11th May / 12th May,  our JCK19 simple API suite  tests crash on Linux aarch64 . They run into the following guarantee .
Issue can be seen in the opt / product build results (seems Darwin aarch64 has similar issues); fastdebug shows an assertion instead.

Suite is executed with -Xcomp -Xbatch -XX:ReservedCodeCacheSize=512M -XX:-TieredCompilation , this has most likely an influence on the issue.
We run into the guarantee in  test  api/java_time/test/java/time/TestInstant.html  (see Current CompileTask:  output)


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (assembler_aarch64.hpp:251), pid=1910, tid=2068
#  guarantee(val < (1ULL << nbits)) failed: Field too big for insn
#
# JRE version: OpenJDK Runtime Environment (19.0) (build 19-internal-adhoc..jdk-dev)
# Java VM: OpenJDK 64-Bit Server VM (19-internal-adhoc..jdk-dev, compiled mode, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
# Problematic frame:
# V  [libjvm.so+0xb06f14]  Instruction_aarch64::f(unsigned int, int, int) [clone .isra.29]+0x5c
#
# Core dump will be written. Default location: /output_openjdk19_dev_optU_linuxaarch64/jck_simple_api_c2_work/core
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

---------------  S U M M A R Y ------------

Command Line: -Djava.awt.headless=true -Xms128m -Xmx288m -XX:MaxJavaStackTraceDepth=512 -Xverify:all -XX:NativeMemoryTracking=summary -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMTStatistics -Xverify:all --enable-preview -Djdk.includeInExceptions=hostInfo,jar -Djdk.xml.xpathExprGrpLimit=20 -Dsun.net.maxDatagramSockets=50 -Xss4M -Xcomp -Xbatch -XX:ReservedCodeCacheSize=512M -XX:-TieredCompilation -XX:+PrintCodeCache -Djdk.xml.maxXMLNameLimit=4000 -Djava.net.preferIPv4Stack=true -Djava.security.auth.policy=/jck/jck19/JCK-runtime-19/lib/jck.auth.policy -Djava.security.auth.login.config=/jck/jck19/JCK-runtime-19/lib/jck.auth.login.config -Djava.security.policy=/jck/jck19/JCK-runtime-19/lib/jck.policy -Djava.io.tmpdir=/output_openjdk19_dev_optU_linuxaarch64/jck_simple_api_c2_work/tempdir -Djavatest.security.allowPropertiesAccess=true -Djava.util.prefs.userRoot=/priv/jvmtests/output_openjdk19_dev_optU_linuxaarch64/jck_simple_api_c2_work/tempdir -Djava.util.prefs.systemRoot=/output_openjdk19_dev_optU_linuxaarch64/jck_simple_api_c2_work/tempdir -Djava.rmi.activation.port=6284 com.sun.javatest.agent.AgentMain -active -activeHost localhost -activePort 6584

Host: AArch64, 8 cores, 62G, Ubuntu 18.04.5 LTS
Time: Thu May 19 21:59:55 2022 CEST elapsed time: 6485.271405 seconds (0d 1h 48m 5s)

---------------  T H R E A D  ---------------

Current thread (0x0000ffff8c246190):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=2068, stack(0x0000ffff601cb000,0x0000ffff603cb000)]


Current CompileTask:
C2:6485271 134927    b        test.java.time.TestInstant::test_millisUntil (47 bytes)

Stack: [0x0000ffff601cb000,0x0000ffff603cb000],  sp=0x0000ffff603c6380,  free space=2028k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xb06f14]  Instruction_aarch64::f(unsigned int, int, int) [clone .isra.29]+0x5c
V  [libjvm.so+0xb09238]  MacroAssembler::mov_immediate64(RegisterImpl const*, unsigned long)+0x1f0
V  [libjvm.so+0xb0ce28]  MacroAssembler::wrap_adds_subs_imm_insn(RegisterImpl const*, RegisterImpl const*, unsigned long, void (MacroAssembler::*)(RegisterImpl const*, RegisterImpl const*, unsigned int), void (MacroAssembler::*)(RegisterImpl const*, RegisterImpl const*, RegisterImpl const*, Assembler::shift_kind, unsigned int), bool)+0xa0
V  [libjvm.so+0x3534d0]  overflowAddL_reg_immNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0xc8
V  [libjvm.so+0xc20ef8]  PhaseOutput::scratch_emit_size(Node const*)+0x1a0
V  [libjvm.so+0xc1d4fc]  PhaseOutput::shorten_branches(unsigned int*)+0x23c
V  [libjvm.so+0xc25898]  PhaseOutput::Output()+0x458
V  [libjvm.so+0x5e4014]  Compile::Code_Gen()+0x344
V  [libjvm.so+0x5e83cc]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0xa24
V  [libjvm.so+0x5229ac]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0xbc
V  [libjvm.so+0x5f05a0]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x6e0
V  [libjvm.so+0x5f140c]  CompileBroker::compiler_thread_loop()+0x494
V  [libjvm.so+0xe704e4]  JavaThread::thread_main_inner()+0xbc
V  [libjvm.so+0xe75ebc]  Thread::call_run()+0x6c
V  [libjvm.so+0xc0ad04]  thread_native_entry(Thread*)+0xdc
C  [libpthread.so.0+0x7088]  start_thread+0xb0
Comments
Checked that failed api/java_time/test/java/time/TestInstant.html jck test passed in JDK 19 ATR.
12-07-2022

Fix request [17u] I backport this for parity with 17.0.5-oracle. A C2 fix we should backport before 8285923 Clean backport. SAP nightly testing passed.
23-06-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/498 Date: 2022-06-22 12:38:09 +0000
22-06-2022

Changeset: 593d2b7d Author: Andrew Haley <aph@openjdk.org> Date: 2022-05-25 07:26:21 +0000 URL: https://git.openjdk.java.net/jdk/commit/593d2b7dab934875527249be6840f328147b72b3
25-05-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/8845 Date: 2022-05-23 14:55:34 +0000
23-05-2022

OK, thanks for the additional info [~mbaesken]. I did a more detailed analysis and the bug is uncovered (but not necessarily caused) by JDK-8286163, which makes sense since it modifies java.time.Instant.
23-05-2022

Our tests on the 10th May (JDK-8285923 has been pushed on the 9th) were still good, did not show this issue.
23-05-2022

JDK-8285923 is suspected of causing these failures: it was integrated just two days before the failure observations, touched code around the failing assertion in macroAssembler_aarch64.cpp, and is a redo of JDK-8285802 which caused similar "Field too big for insn" failures. [~aph] could you have a look?
23-05-2022

ILW = crash in product build; in JCK test using non-standard configuration; use default configuration = HML = P2
23-05-2022

With fastdebug binaries we get a crash too in api/java_time/test/java/time/TestInstant.html (this time on mac aarch64). But this time an assertion (porbably because it is fastdenug) with a bit different backtrace. We again run with -Xcomp -Xbatch -XX:-TieredCompilation . # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/darwinaarch64/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:2297), pid=51651, tid=41475 # assert(Rd != zr) failed: overflow in immediate operand # # JRE version: OpenJDK Runtime Environment (19.0) (fastdebug build 19-internal-adhoc.openjdk.jdk) # Java VM: OpenJDK 64-Bit Server VM (fastdebug 19-internal-adhoc.openjdk.jdk, compiled mode, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) # Core dump will be written. Default location: /cores/core.51651 # # If you would like to submit a bug report, please visit: # https://bugreport.java.com/bugreport/crash.jsp # --------------- S U M M A R Y ------------ Command Line: -Djava.awt.headless=true -Xms128m -Xmx288m -XX:MaxJavaStackTraceDepth=512 -Xverify:all -XX:NativeMemoryTracking=summary -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMTStatistics -Xverify:all -Djdk.includeInExceptions=hostInfo,jar -Djdk.xml.xpathExprGrpLimit=20 -Dsun.net.maxDatagramSockets=50 -Xss4M -Xcomp -Xbatch -XX:ReservedCodeCacheSize=512M -XX:-TieredCompilation -XX:+PrintCodeCache -Djdk.xml.maxXMLNameLimit=4000 -Djava.net.preferIPv4Stack=true -Djava.security.auth.policy=/jck/jck19/JCK-runtime-19/lib/jck.auth.policy -Djava.security.auth.login.config=/jck/jck19/JCK-runtime-19/lib/jck.auth.login.config -Djava.security.policy=/jck/jck19/JCK-runtime-19/lib/jck.policy -Djava.io.tmpdir=/output_openjdk19_stage_dbgU_darwinaarch64/jck_simple_api_c2_work/tempdir -Djavatest.security.allowPropertiesAccess=true -Djava.util.prefs.userRoot=/output_openjdk19_stage_dbgU_darwinaarch64/jck_simple_api_c2_work/tempdir -Djava.util.prefs.systemRoot=/output_openjdk19_stage_dbgU_darwinaarch64/jck_simple_api_c2_work/tempdir -Djava.rmi.activation.port=6286 com.sun.javatest.agent.AgentMain -active -activeHost localhost -activePort 6586 Host: mymac, "Macmini9,1" arm64, 8 cores, 16G, Darwin 20.6.0, macOS 11.6.1 (20G224) Time: Mon May 23 04:52:11 2022 CEST elapsed time: 8263.794773 seconds (0d 2h 17m 43s) --------------- T H R E A D --------------- Current thread (0x0000000131018810): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=41475, stack(0x000000016fd78000,0x000000016ff7b000)] Current CompileTask: C2:8263794 134913 b test.java.time.TestInstant::test_millisUntil (47 bytes) Stack: [0x000000016fd78000,0x000000016ff7b000], sp=0x000000016ff76a20, free space=2042k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.dylib+0x12b8b80] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x5d4 V [libjvm.dylib+0x12b92c0] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, char*)+0x40 V [libjvm.dylib+0x607660] report_vm_error(char const*, int, char const*, char const*, ...)+0x80 V [libjvm.dylib+0xd5b0a4] MacroAssembler::wrap_adds_subs_imm_insn(RegisterImpl const*, RegisterImpl const*, unsigned long long, void (MacroAssembler::*)(RegisterImpl const*, RegisterImpl const*, unsigned int), void (MacroAssembler::*)(RegisterImpl const*, RegisterImpl const*, RegisterImpl const*, Assembler::shift_kind, unsigned int), bool)+0xc8 V [libjvm.dylib+0x6a530] overflowAddL_reg_immNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x150 V [libjvm.dylib+0xed3ea8] PhaseOutput::scratch_emit_size(Node const*)+0x2d0 V [libjvm.dylib+0xec9304] PhaseOutput::shorten_branches(unsigned int*)+0x458 V [libjvm.dylib+0xec8af8] PhaseOutput::Output()+0xb38 V [libjvm.dylib+0x57048c] Compile::Code_Gen()+0x3c4 V [libjvm.dylib+0x56def8] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1410 V [libjvm.dylib+0x465ff8] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x180 V [libjvm.dylib+0x589788] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x85c V [libjvm.dylib+0x588d5c] CompileBroker::compiler_thread_loop()+0x298 V [libjvm.dylib+0x1208f8c] JavaThread::thread_main_inner()+0x26c V [libjvm.dylib+0x1208d00] JavaThread::run()+0x3c4 V [libjvm.dylib+0x1205b38] Thread::call_run()+0x220 V [libjvm.dylib+0xeb9064] thread_native_entry(Thread*)+0x160 C [libsystem_pthread.dylib+0x7878] _pthread_start+0x140
23-05-2022