# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/build/jdk-jdk/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp:1021), pid=2924, tid=2930
# assert(type == T_INT) failed: unexpected type
Source code gives assertion (two places, type is T_LONG):
LIR_Opr LIRGenerator::atomic_add(BasicType type, LIR_Opr addr, LIRItem& value) {
LIR_Opr result = new_register(type);
value.load_item();
assert(type == T_INT LP64_ONLY( || type == T_LONG), "unexpected type");
LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) {
bool is_oop = type == T_OBJECT || type == T_ARRAY;
LIR_Opr result = new_register(type);
value.load_item();
assert(type == T_INT || is_oop LP64_ONLY( || type == T_LONG ), "unexpected type");
Minimal test to reproduce assertion:
class Test {
private static final AtomicLong COUNT = new AtomicLong();
private static void test() {
COUNT.incrementAndGet();
}
public static void main(String args[]) {
test();
}
}
Command line to reproduce the assertion:
./jdk-11/fastdebug/bin/java -Xcomp -XX:CompileOnly=Test::test -XX:+TieredCompilation -XX:TieredStopAtLevel=1 Test
Stack from crash report file:
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xe827f8] VMError::report_and_die(int, char const*, char const*, std::__va_list, Thread*, unsigned char*, void*, void*, char const*, int, unsigned int)+0x280
V [libjvm.so+0xe83744] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, std::__va_list)+0x38
V [libjvm.so+0x4df220] report_vm_error(char const*, int, char const*, char const*, ...)+0xb8
V [libjvm.so+0x228164] LIRGenerator::atomic_add(BasicType, LIR_OprDesc*, LIRItem&)+0x7c
V [libjvm.so+0x219ee0] LIRGenerator::access_atomic_add_at(unsigned long long, BasicType, LIRItem&, LIRItem&, LIRItem&)+0x104
V [libjvm.so+0x219fec] LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject*)+0xe4
V [libjvm.so+0x201018] LIRGenerator::do_root(Instruction*)+0xb4
V [libjvm.so+0x2012a0] non-virtual thunk to LIRGenerator::block_do(BlockBegin*)+0x80
V [libjvm.so+0x1c4c30] BlockList::iterate_forward(BlockClosure*)+0x68
V [libjvm.so+0x17a76c] Compilation::emit_lir()+0x4d4
V [libjvm.so+0x17d0b8] Compilation::compile_java_method()+0x468
V [libjvm.so+0x17e0fc] Compilation::compile_method()+0x1f8
V [libjvm.so+0x17ed90] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, DirectiveSet*)+0x320
V [libjvm.so+0x181614] Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x11c
V [libjvm.so+0x434170] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x364
V [libjvm.so+0x4350e0] CompileBroker::compiler_thread_loop()+0x3f8
V [libjvm.so+0xde6148] JavaThread::thread_main_inner()+0x230
V [libjvm.so+0xde6420] JavaThread::run()+0x20c
V [libjvm.so+0xbb66bc] thread_native_entry(Thread*)+0x120
C [libpthread.so.0+0x5fc4] start_thread+0xb4
#
# Internal Error (/home/build/jdk-jdk/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp:1021), pid=2924, tid=2930
# assert(type == T_INT) failed: unexpected type
Source code gives assertion (two places, type is T_LONG):
LIR_Opr LIRGenerator::atomic_add(BasicType type, LIR_Opr addr, LIRItem& value) {
LIR_Opr result = new_register(type);
value.load_item();
assert(type == T_INT LP64_ONLY( || type == T_LONG), "unexpected type");
LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) {
bool is_oop = type == T_OBJECT || type == T_ARRAY;
LIR_Opr result = new_register(type);
value.load_item();
assert(type == T_INT || is_oop LP64_ONLY( || type == T_LONG ), "unexpected type");
Minimal test to reproduce assertion:
class Test {
private static final AtomicLong COUNT = new AtomicLong();
private static void test() {
COUNT.incrementAndGet();
}
public static void main(String args[]) {
test();
}
}
Command line to reproduce the assertion:
./jdk-11/fastdebug/bin/java -Xcomp -XX:CompileOnly=Test::test -XX:+TieredCompilation -XX:TieredStopAtLevel=1 Test
Stack from crash report file:
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xe827f8] VMError::report_and_die(int, char const*, char const*, std::__va_list, Thread*, unsigned char*, void*, void*, char const*, int, unsigned int)+0x280
V [libjvm.so+0xe83744] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, std::__va_list)+0x38
V [libjvm.so+0x4df220] report_vm_error(char const*, int, char const*, char const*, ...)+0xb8
V [libjvm.so+0x228164] LIRGenerator::atomic_add(BasicType, LIR_OprDesc*, LIRItem&)+0x7c
V [libjvm.so+0x219ee0] LIRGenerator::access_atomic_add_at(unsigned long long, BasicType, LIRItem&, LIRItem&, LIRItem&)+0x104
V [libjvm.so+0x219fec] LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject*)+0xe4
V [libjvm.so+0x201018] LIRGenerator::do_root(Instruction*)+0xb4
V [libjvm.so+0x2012a0] non-virtual thunk to LIRGenerator::block_do(BlockBegin*)+0x80
V [libjvm.so+0x1c4c30] BlockList::iterate_forward(BlockClosure*)+0x68
V [libjvm.so+0x17a76c] Compilation::emit_lir()+0x4d4
V [libjvm.so+0x17d0b8] Compilation::compile_java_method()+0x468
V [libjvm.so+0x17e0fc] Compilation::compile_method()+0x1f8
V [libjvm.so+0x17ed90] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, DirectiveSet*)+0x320
V [libjvm.so+0x181614] Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x11c
V [libjvm.so+0x434170] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x364
V [libjvm.so+0x4350e0] CompileBroker::compiler_thread_loop()+0x3f8
V [libjvm.so+0xde6148] JavaThread::thread_main_inner()+0x230
V [libjvm.so+0xde6420] JavaThread::run()+0x20c
V [libjvm.so+0xbb66bc] thread_native_entry(Thread*)+0x120
C [libpthread.so.0+0x5fc4] start_thread+0xb4
- duplicates
-
JDK-8231952 ARM32: Wrong assumption in assertion in LIRGenerator::atomic_xchg and LIRGenerator::atomic_add
-
- Resolved
-