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

UndefinedBehaviorSanitizer

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 21
    • 21
    • hotspot
    • b06

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: