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/share/classfile/classFileParser.cpp:1810 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1811 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1812 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1813 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1815 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
Misaligned pointer use
#0 0x0000000111242a1b in copy_lvt_element(Classfile_LVT_Element const*, LocalVariableTableElement*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1810
#1 0x000000011124227f in ClassFileParser::copy_localvariable_table(ConstMethod const*, int, unsigned short*, void const**, int, unsigned short*, void const**, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:2152
#2 0x0000000111246083 in ClassFileParser::parse_method(ClassFileStream const*, bool, ConstantPool const*, bool*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:2822
#3 0x00000001112473bb in ClassFileParser::parse_methods(ClassFileStream const*, bool, bool*, bool*, bool*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:2902
#4 0x0000000111255cd7 in ClassFileParser::parse_stream(ClassFileStream const*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:5904
#5 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
#6 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
#7 0x00000001112b21a3 in ClassLoader::load_class(Symbol*, bool, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classLoader.cpp:1212
#8 0x0000000111297ae3 in SystemDictionary::load_instance_class_impl(Symbol*, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:1348
#9 0x00000001112944f3 in SystemDictionary::load_instance_class(Symbol*, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:1412
#10 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
#11 0x00000001112920af in SystemDictionary::resolve_or_null(Symbol*, Handle, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:340
#12 0x0000000111291e67 in SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:318
#13 0x00000001119af21b in ConstantPool::klass_at_impl(constantPoolHandle const&, int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/constantPool.cpp:538
#14 0x000000011112e66f in ConstantPool::klass_at(int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/constantPool.hpp:405
#15 0x00000001109ead73 in InterpreterRuntime::_new(JavaThread*, ConstantPool*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/interpreterRuntime.cpp:220
#16 0x000000012f555c83 in 0x12f555c83 ()
#23 0x000000012f53417b in 0x12f53417b ()
#24 0x0000000110ea2d8f in JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:417
#25 0x0000000110ea1f83 in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:258
#26 0x0000000110ea209f in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:264
#27 0x0000000110efa097 in call_initPhase1(JavaThread*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:283
#28 0x0000000110efa060 in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:368
#29 0x0000000110efa05f in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:365
#30 0x0000000110efb4df in Threads::create_vm(JavaVMInitArgs*, bool*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:631
#31 0x0000000111111b0b in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3591
#32 0x0000000111111a74 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3677
#33 0x0000000111111a73 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3671
#34 0x00000001001027f7 in InitializeJVM [inlined] at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:1459
#35 0x0000000100102744 in JavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:413
#36 0x0000000100102743 in JavaMain ()
#37 0x00000001001053f7 in ThreadJavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/macosx/native/libjli/java_md_macosx.m:720
#38 0x00000001000995d3 in _pthread_start ()
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1810 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1811 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1812 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1813 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
/Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1815 Member access within misaligned address 0x000101015865 for type 'const Classfile_LVT_Element', which requires 2 byte alignment
Misaligned pointer use
#0 0x0000000111242a1b in copy_lvt_element(Classfile_LVT_Element const*, LocalVariableTableElement*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:1810
#1 0x000000011124227f in ClassFileParser::copy_localvariable_table(ConstMethod const*, int, unsigned short*, void const**, int, unsigned short*, void const**, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:2152
#2 0x0000000111246083 in ClassFileParser::parse_method(ClassFileStream const*, bool, ConstantPool const*, bool*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:2822
#3 0x00000001112473bb in ClassFileParser::parse_methods(ClassFileStream const*, bool, bool*, bool*, bool*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:2902
#4 0x0000000111255cd7 in ClassFileParser::parse_stream(ClassFileStream const*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classFileParser.cpp:5904
#5 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
#6 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
#7 0x00000001112b21a3 in ClassLoader::load_class(Symbol*, bool, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/classLoader.cpp:1212
#8 0x0000000111297ae3 in SystemDictionary::load_instance_class_impl(Symbol*, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:1348
#9 0x00000001112944f3 in SystemDictionary::load_instance_class(Symbol*, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:1412
#10 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
#11 0x00000001112920af in SystemDictionary::resolve_or_null(Symbol*, Handle, Handle, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:340
#12 0x0000000111291e67 in SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/classfile/systemDictionary.cpp:318
#13 0x00000001119af21b in ConstantPool::klass_at_impl(constantPoolHandle const&, int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/constantPool.cpp:538
#14 0x000000011112e66f in ConstantPool::klass_at(int, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/constantPool.hpp:405
#15 0x00000001109ead73 in InterpreterRuntime::_new(JavaThread*, ConstantPool*, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/interpreterRuntime.cpp:220
#16 0x000000012f555c83 in 0x12f555c83 ()
#23 0x000000012f53417b in 0x12f53417b ()
#24 0x0000000110ea2d8f in JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:417
#25 0x0000000110ea1f83 in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:258
#26 0x0000000110ea209f in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/javaCalls.cpp:264
#27 0x0000000110efa097 in call_initPhase1(JavaThread*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:283
#28 0x0000000110efa060 in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:368
#29 0x0000000110efa05f in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:365
#30 0x0000000110efb4df in Threads::create_vm(JavaVMInitArgs*, bool*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:631
#31 0x0000000111111b0b in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3591
#32 0x0000000111111a74 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3677
#33 0x0000000111111a73 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3671
#34 0x00000001001027f7 in InitializeJVM [inlined] at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:1459
#35 0x0000000100102744 in JavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:413
#36 0x0000000100102743 in JavaMain ()
#37 0x00000001001053f7 in ThreadJavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/macosx/native/libjli/java_md_macosx.m:720
#38 0x00000001000995d3 in _pthread_start ()
- relates to
-
JDK-8300795 UB: Load of misaligned address 0x000101015035 for type 'u2' (aka 'unsigned short'), which requires 2 byte alignment
- Closed
-
JDK-8300935 Turn ON runtime sanitizer in clang toolkit to find issues
- Closed