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/bytes_aarch64.hpp:35 Load of misaligned address 0x000101015035 for type 'u2' (aka 'unsigned short'), which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp:679 Load of misaligned address 0x00012f53417c for type 'uint64_t' (aka 'unsigned long long'), which requires 8 byte alignment
Misaligned pointer use
#0 0x0000000110ab52d7 in Bytes::get_native_u2(unsigned char*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/bytes_aarch64.hpp:35
#1 0x0000000110ab52c0 in Bytes::get_Java_u2(unsigned char*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/bytes_aarch64.hpp:47
#2 0x0000000110ab52c0 in ClassFileStream::get_u2_fast() const at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileStream.hpp:110
#3 0x0000000110ab52bf in ClassFileStream::get_u2_fast() const ()
#4 0x0000000110ab52bf in ClassFileStream::get_u2_fast() const ()
#5 0x0000000111236147 in ClassFileParser::parse_constant_pool_entries(ClassFileStream const*, ConstantPool*, int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:200
#6 0x000000011123739b in ClassFileParser::parse_constant_pool(ClassFileStream const*, ConstantPool*, int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:430
#7 0x0000000111255633 in ClassFileParser::parse_stream(ClassFileStream const*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:5766
#8 0x000000011125515f in ClassFileParser::ClassFileParser(ClassFileStream*, Symbol*, ClassLoaderData*, ClassLoadInfo const*, ClassFileParser::Publicity, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:5636
#9 0x00000001111aa9c3 in KlassFactory::create_from_stream(ClassFileStream*, Symbol*, ClassLoaderData*, ClassLoadInfo const&, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/klassFactory.cpp:196
#10 0x00000001112b21a3 in ClassLoader::load_class(Symbol*, bool, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classLoader.cpp:1212
#11 0x0000000111297ae3 in SystemDictionary::load_instance_class_impl(Symbol*, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:1348
#12 0x00000001112944f3 in SystemDictionary::load_instance_class(Symbol*, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:1412
#13 0x0000000111292fcf in SystemDictionary::resolve_instance_class_or_null(Symbol*, Handle, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:768
#14 0x00000001112920af in SystemDictionary::resolve_or_null(Symbol*, Handle, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:340
#15 0x0000000111291e67 in SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:318
#16 0x00000001119af21b in ConstantPool::klass_at_impl(constantPoolHandle const&, int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/constantPool.cpp:538
#17 0x000000011112e66f in ConstantPool::klass_at(int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/constantPool.hpp:405
#18 0x00000001109ead73 in InterpreterRuntime::_new(JavaThread*, ConstantPool*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/interpreterRuntime.cpp:220
#19 0x000000012f555c83 in 0x12f555c83 ()
#26 0x000000012f53417b in 0x12f53417b ()
#27 0x0000000110ea2d8f in JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:417
#28 0x0000000110ea1f83 in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:258
#29 0x0000000110ea209f in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:264
#30 0x0000000110efa097 in call_initPhase1(JavaThread*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:283
#31 0x0000000110efa060 in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:368
#32 0x0000000110efa05f in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:365
#33 0x0000000110efb4df in Threads::create_vm(JavaVMInitArgs*, bool*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:631
#34 0x0000000111111b0b in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3591
#35 0x0000000111111a74 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3677
#36 0x0000000111111a73 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3671
#37 0x00000001001027f7 in InitializeJVM [inlined] at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:1459
#38 0x0000000100102744 in JavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:413
#39 0x0000000100102743 in JavaMain ()
#40 0x00000001001053f7 in ThreadJavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/macosx/native/libjli/java_md_macosx.m:720
#41 0x00000001000995d3 in _pthread_start ()
/Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/bytes_aarch64.hpp:35 Load of misaligned address 0x000101015035 for type 'u2' (aka 'unsigned short'), which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp:679 Load of misaligned address 0x00012f53417c for type 'uint64_t' (aka 'unsigned long long'), which requires 8 byte alignment
Misaligned pointer use
#0 0x0000000110ab52d7 in Bytes::get_native_u2(unsigned char*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/bytes_aarch64.hpp:35
#1 0x0000000110ab52c0 in Bytes::get_Java_u2(unsigned char*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/bytes_aarch64.hpp:47
#2 0x0000000110ab52c0 in ClassFileStream::get_u2_fast() const at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileStream.hpp:110
#3 0x0000000110ab52bf in ClassFileStream::get_u2_fast() const ()
#4 0x0000000110ab52bf in ClassFileStream::get_u2_fast() const ()
#5 0x0000000111236147 in ClassFileParser::parse_constant_pool_entries(ClassFileStream const*, ConstantPool*, int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:200
#6 0x000000011123739b in ClassFileParser::parse_constant_pool(ClassFileStream const*, ConstantPool*, int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:430
#7 0x0000000111255633 in ClassFileParser::parse_stream(ClassFileStream const*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:5766
#8 0x000000011125515f in ClassFileParser::ClassFileParser(ClassFileStream*, Symbol*, ClassLoaderData*, ClassLoadInfo const*, ClassFileParser::Publicity, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:5636
#9 0x00000001111aa9c3 in KlassFactory::create_from_stream(ClassFileStream*, Symbol*, ClassLoaderData*, ClassLoadInfo const&, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/klassFactory.cpp:196
#10 0x00000001112b21a3 in ClassLoader::load_class(Symbol*, bool, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classLoader.cpp:1212
#11 0x0000000111297ae3 in SystemDictionary::load_instance_class_impl(Symbol*, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:1348
#12 0x00000001112944f3 in SystemDictionary::load_instance_class(Symbol*, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:1412
#13 0x0000000111292fcf in SystemDictionary::resolve_instance_class_or_null(Symbol*, Handle, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:768
#14 0x00000001112920af in SystemDictionary::resolve_or_null(Symbol*, Handle, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:340
#15 0x0000000111291e67 in SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:318
#16 0x00000001119af21b in ConstantPool::klass_at_impl(constantPoolHandle const&, int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/constantPool.cpp:538
#17 0x000000011112e66f in ConstantPool::klass_at(int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/constantPool.hpp:405
#18 0x00000001109ead73 in InterpreterRuntime::_new(JavaThread*, ConstantPool*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/interpreterRuntime.cpp:220
#19 0x000000012f555c83 in 0x12f555c83 ()
#26 0x000000012f53417b in 0x12f53417b ()
#27 0x0000000110ea2d8f in JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:417
#28 0x0000000110ea1f83 in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:258
#29 0x0000000110ea209f in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:264
#30 0x0000000110efa097 in call_initPhase1(JavaThread*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:283
#31 0x0000000110efa060 in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:368
#32 0x0000000110efa05f in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:365
#33 0x0000000110efb4df in Threads::create_vm(JavaVMInitArgs*, bool*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:631
#34 0x0000000111111b0b in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3591
#35 0x0000000111111a74 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3677
#36 0x0000000111111a73 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3671
#37 0x00000001001027f7 in InitializeJVM [inlined] at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:1459
#38 0x0000000100102744 in JavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:413
#39 0x0000000100102743 in JavaMain ()
#40 0x00000001001053f7 in ThreadJavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/macosx/native/libjli/java_md_macosx.m:720
#41 0x00000001000995d3 in _pthread_start ()
- duplicates
-
JDK-8300822 UB: Load of misaligned address 0x00012f53417c for type 'uint64_t' (aka 'unsigned long long'), which requires 8 byte alignment
- Closed
- relates to
-
JDK-8300824 UB: Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
- Closed
-
JDK-8300935 Turn ON runtime sanitizer in clang toolkit to find issues
- Closed