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

UB: Left shift of negative value -1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • infrastructure
    • 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/gc/g1/g1CardSet.cpp:113 Left shift of negative value -1

      Invalid shift base
      #0 0x0000000111494813 in G1CardSetConfiguration::G1CardSetConfiguration(unsigned int, unsigned int, double, unsigned int, double, unsigned int, unsigned int) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/gc/g1/g1CardSet.cpp:113
      #1 0x00000001114949c8 in G1CardSetConfiguration::G1CardSetConfiguration(unsigned int, unsigned int, double, unsigned int, double, unsigned int, unsigned int) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/gc/g1/g1CardSet.cpp:115
      #2 0x00000001114948ef in G1CardSetConfiguration::G1CardSetConfiguration() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/gc/g1/g1CardSet.cpp:68
      #3 0x000000011152f3f3 in G1CollectedHeap::G1CollectedHeap() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/gc/g1/g1CollectedHeap.cpp:1448
      #4 0x000000011145487b in G1Arguments::create_heap() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/gc/g1/g1Arguments.cpp:262
      #5 0x0000000110a3f6fb in Universe::initialize_heap() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/memory/universe.cpp:843
      #6 0x0000000110a3f3af in universe_init() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/memory/universe.cpp:777
      #7 0x0000000110eb94a3 in init_globals() at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/init.cpp:121
      #8 0x0000000110efb29f in Threads::create_vm(JavaVMInitArgs*, bool*) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/runtime/threads.cpp:564
      #9 0x0000000111111b0b in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) [inlined] at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3591
      #10 0x0000000111111a74 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3677
      #11 0x0000000111111a73 in ::JNI_CreateJavaVM(JavaVM **, void **, void *) at /Users/gerard/Work/tmp/jdk/src/hotspot/share/prims/jni.cpp:3671
      #12 0x00000001001027f7 in InitializeJVM [inlined] at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:1459
      #13 0x0000000100102744 in JavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/share/native/libjli/java.c:413
      #14 0x0000000100102743 in JavaMain ()
      #15 0x00000001001053f7 in ThreadJavaMain at /Users/gerard/Work/tmp/jdk/src/java.base/macosx/native/libjli/java_md_macosx.m:720
      #16 0x00000001000995d3 in _pthread_start ()

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

              Created:
              Updated:
              Resolved: