Undefined Behavior discovered after turning "UndefinedBehaviorSanitizer" in Xcode running simple HelloWorld java app. More info on clang undefined behavior sanitizer can be found https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
/Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:430 Left shift of negative value -1
Invalid shift base
#0 0x0000000110846d93 in Decoder::adrp(unsigned char*, unsigned char*&, int (*)(unsigned char*, unsigned char*&)) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:430
#1 0x00000001108178ef in RelocActions::run(unsigned char*, unsigned char*&) [inlined] ()
#2 0x00000001108178ac in MacroAssembler::target_addr_for_insn(unsigned char*, unsigned int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:496
#3 0x00000001108178ab in MacroAssembler::target_addr_for_insn(unsigned char*, unsigned int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:497
#4 0x0000000110848184 in MacroAssembler::target_addr_for_insn(unsigned char*) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:605
#5 0x000000011097c8e7 in MacroAssembler::pd_call_destination(unsigned char*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:619
#6 0x000000011097c8e0 in Relocation::pd_call_destination(unsigned char*) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp:70
#7 0x000000011097c8df in Relocation::pd_call_destination(unsigned char*) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp:69
#8 0x0000000110f78f3b in CallRelocation::fix_relocation_after_move(CodeBuffer const*, CodeBuffer*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/relocInfo.cpp:393
#9 0x0000000110a0d17f in CodeBuffer::relocate_code_to(CodeBuffer*) const at /Users/gerard/Work/tmp/jdk/src/hotspot/share/asm/codeBuffer.cpp:784
#10 0x0000000110a0c8a7 in CodeBuffer::copy_code_to(CodeBlob*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/asm/codeBuffer.cpp:719
#11 0x0000000110f53753 in RuntimeBlob::RuntimeBlob(char const*, CodeBuffer*, int, int, int, int, OopMapSet*, bool) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/codeBlob.cpp:161
#12 0x0000000110f54e6b in RuntimeStub::RuntimeStub(char const*, CodeBuffer*, int, int, int, OopMapSet*, bool) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/codeBlob.cpp:406
#13 0x0000000110f54ee8 in RuntimeStub::RuntimeStub(char const*, CodeBuffer*, int, int, int, OopMapSet*, bool) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/codeBlob.cpp:407
#14 0x0000000110f54fff in RuntimeStub::new_runtime_stub(char const*, CodeBuffer*, int, int, OopMapSet*, bool) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/codeBlob.cpp:422
#15 0x000000011085b333 in StubGenerator::generate_throw_exception(char const*, unsigned char*, Register, Register) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:7076
#16 0x0000000110856de7 in StubGenerator::generate_initial() at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:7928
#17 0x0000000110856d03 in StubGenerator::StubGenerator(CodeBuffer*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:8119
#18 0x0000000110856c48 in StubGenerator::StubGenerator(CodeBuffer*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:8117
#19 0x0000000110856bfb in StubGenerator_generate(CodeBuffer*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:8133
#20 0x0000000110e7075f in StubRoutines::initialize1() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/stubRoutines.cpp:226
#21 0x0000000110e71c38 in stubRoutines_init1() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/stubRoutines.cpp:387
#22 0x0000000110eb949f in init_globals() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/init.cpp:120
#23 0x0000000110efb29f in Threads::create_vm(JavaVMInitArgs*, bool*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:564
#24 0x0000000111111b0b in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3591
#25 0x0000000111111a74 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3677
#26 0x0000000111111a73 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3671
#27 0x00000001001027f7 in InitializeJVM [inlined] at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:1459
#28 0x0000000100102744 in JavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:413
#29 0x0000000100102743 in JavaMain ()
#30 0x00000001001053f7 in ThreadJavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/macosx/native/libjli/java_md_macosx.m:720
#31 0x00000001000995d3 in _pthread_start ()
/Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:430 Left shift of negative value -1
Invalid shift base
#0 0x0000000110846d93 in Decoder::adrp(unsigned char*, unsigned char*&, int (*)(unsigned char*, unsigned char*&)) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:430
#1 0x00000001108178ef in RelocActions::run(unsigned char*, unsigned char*&) [inlined] ()
#2 0x00000001108178ac in MacroAssembler::target_addr_for_insn(unsigned char*, unsigned int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:496
#3 0x00000001108178ab in MacroAssembler::target_addr_for_insn(unsigned char*, unsigned int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:497
#4 0x0000000110848184 in MacroAssembler::target_addr_for_insn(unsigned char*) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:605
#5 0x000000011097c8e7 in MacroAssembler::pd_call_destination(unsigned char*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:619
#6 0x000000011097c8e0 in Relocation::pd_call_destination(unsigned char*) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp:70
#7 0x000000011097c8df in Relocation::pd_call_destination(unsigned char*) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp:69
#8 0x0000000110f78f3b in CallRelocation::fix_relocation_after_move(CodeBuffer const*, CodeBuffer*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/relocInfo.cpp:393
#9 0x0000000110a0d17f in CodeBuffer::relocate_code_to(CodeBuffer*) const at /Users/gerard/Work/tmp/jdk/src/hotspot/share/asm/codeBuffer.cpp:784
#10 0x0000000110a0c8a7 in CodeBuffer::copy_code_to(CodeBlob*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/asm/codeBuffer.cpp:719
#11 0x0000000110f53753 in RuntimeBlob::RuntimeBlob(char const*, CodeBuffer*, int, int, int, int, OopMapSet*, bool) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/codeBlob.cpp:161
#12 0x0000000110f54e6b in RuntimeStub::RuntimeStub(char const*, CodeBuffer*, int, int, int, OopMapSet*, bool) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/codeBlob.cpp:406
#13 0x0000000110f54ee8 in RuntimeStub::RuntimeStub(char const*, CodeBuffer*, int, int, int, OopMapSet*, bool) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/codeBlob.cpp:407
#14 0x0000000110f54fff in RuntimeStub::new_runtime_stub(char const*, CodeBuffer*, int, int, OopMapSet*, bool) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/code/codeBlob.cpp:422
#15 0x000000011085b333 in StubGenerator::generate_throw_exception(char const*, unsigned char*, Register, Register) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:7076
#16 0x0000000110856de7 in StubGenerator::generate_initial() at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:7928
#17 0x0000000110856d03 in StubGenerator::StubGenerator(CodeBuffer*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:8119
#18 0x0000000110856c48 in StubGenerator::StubGenerator(CodeBuffer*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:8117
#19 0x0000000110856bfb in StubGenerator_generate(CodeBuffer*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp:8133
#20 0x0000000110e7075f in StubRoutines::initialize1() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/stubRoutines.cpp:226
#21 0x0000000110e71c38 in stubRoutines_init1() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/stubRoutines.cpp:387
#22 0x0000000110eb949f in init_globals() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/init.cpp:120
#23 0x0000000110efb29f in Threads::create_vm(JavaVMInitArgs*, bool*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:564
#24 0x0000000111111b0b in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3591
#25 0x0000000111111a74 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3677
#26 0x0000000111111a73 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3671
#27 0x00000001001027f7 in InitializeJVM [inlined] at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:1459
#28 0x0000000100102744 in JavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:413
#29 0x0000000100102743 in JavaMain ()
#30 0x00000001001053f7 in ThreadJavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/macosx/native/libjli/java_md_macosx.m:720
#31 0x00000001000995d3 in _pthread_start ()
- duplicates
-
JDK-8300797 UB: Left shift of negative value -1
- Closed
- relates to
-
JDK-8300935 Turn ON runtime sanitizer in clang toolkit to find issues
- Closed