UndefinedBehaviorSanitizer

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: 21
    • Component/s: hotspot
    • b06

      UBSan (https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) is available in gcc and clang and detects behavior that is undefined according to the C and C++ standards and reports it. I enabled it in https://github.com/jcking/jdk/tree/ubsan and it turns out OpenJDK relies on quite a bit of undefined behavior from unaligned stores/loads, accessing member functions and fields using unaligned pointers, and binding NULL to references.

      To be more well defined, OpenJDK should be buildable with UBSan and the majority of undefined behavior should be replaced. If it is intentional it should be suppressed. Ultimately all tests should be able to pass with a UBSan build.

            Assignee:
            Justin King
            Reporter:
            Justin King
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: