Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8300820

UB: Left shift of negative value -1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • None

      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/oops/klass.hpp:460 Left shift of negative value -1

      Invalid shift base
      #0 0x00000001119a5e1b in Klass::array_layout_helper(int, int, BasicType, int) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/klass.hpp:460
      #1 0x00000001119a5bef in Klass::array_layout_helper(BasicType) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/klass.cpp:217
      #2 0x0000000110903037 in Klass::layout_helper_boolean_diffbit() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/oops/klass.hpp:441
      #3 0x0000000110902ceb in TemplateTable::bastore() at /Users/gerard/Work/tmp/jdk/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp:1168
      #4 0x00000001109dcdd7 in Template::generate(InterpreterMacroAssembler*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/templateTable.cpp:62
      #5 0x00000001109e99af in TemplateInterpreterGenerator::generate_and_dispatch(Template*, TosState) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp:382
      #6 0x00000001109e8c3c in TemplateInterpreterGenerator::set_short_entry_points(Template*, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&) ()
      #7 0x00000001109e82c3 in TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp:315
      #8 0x00000001109e808f in TemplateInterpreterGenerator::set_entry_points_for_all_bytes() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp:271
      #9 0x00000001109e7237 in TemplateInterpreterGenerator::generate_all() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp:229
      #10 0x00000001109e5eff in TemplateInterpreterGenerator::TemplateInterpreterGenerator() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp:40
      #11 0x0000000110a01b3f in TemplateInterpreter::initialize_code() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/templateInterpreter.cpp:66
      #12 0x00000001109bd76b in interpreter_init_code() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/interpreter/interpreter.cpp:137
      #13 0x0000000110eb94d7 in init_globals() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/init.cpp:137
      #14 0x0000000110efb29f in Threads::create_vm(JavaVMInitArgs*, bool*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:564
      #15 0x0000000111111b0b in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3591
      #16 0x0000000111111a74 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3677
      #17 0x0000000111111a73 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3671
      #18 0x00000001001027f7 in InitializeJVM [inlined] at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:1459
      #19 0x0000000100102744 in JavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:413
      #20 0x0000000100102743 in JavaMain ()
      #21 0x00000001001053f7 in ThreadJavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/macosx/native/libjli/java_md_macosx.m:720
      #22 0x00000001000995d3 in _pthread_start ()

            Unassigned Unassigned
            gziemski Gerard Ziemski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: