Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Buildbot

    Attachments

      Issue Links

        Activity

          Reminder to self:

          MDEV-11924 - ASAN in Buildbot - Runtime Address Sanitizer for bounds checking
          Undefined behavior testor:
          Easy win in CI environment

          Thread Safety Analysis (http://clang.llvm.org/docs/ThreadSafetyAnalysis.html)
          Needs to mark variables with mutexs required (attribute and annotate mutex functions)
          C

          Unknown macro: {,XX}

          FLAGS=-Wthread-safety
          Doesn’t seem that difficult or intrusive

          teodor Teodor Mircea Ionita (Inactive) added a comment - Reminder to self: MDEV-11924 - ASAN in Buildbot - Runtime Address Sanitizer for bounds checking Undefined behavior testor: Easy win in CI environment fsanitize=undefined,, -fsanitize=integer, -fsanitize=nullability, http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html ) gcc > 4.8, clang >= 3.3 Run with UBSAN_OPTIONS=print_stacktrace=1 and llvm-symbolizer Thread Safety Analysis ( http://clang.llvm.org/docs/ThreadSafetyAnalysis.html ) Needs to mark variables with mutexs required (attribute and annotate mutex functions) C Unknown macro: {,XX} FLAGS=-Wthread-safety Doesn’t seem that difficult or intrusive

          Here is a simple script to use TSAN.

          #!/bin/bash
           
          git clone --depth=1 --recurse-submodules git@github.com:MariaDB/server.git server
           
          mkdir debug_build
          cd debug_build
           
          COMPILER_FLAGS="-fdiagnostics-color -fno-omit-frame-pointer -gsplit-dwarf"
          cmake \
              -G Ninja \
              -DWITH_TSAN=1 \
              -DCMAKE_BUILD_TYPE=Debug \
              -DCMAKE_C_FLAGS=$COMPILER_FLAGS \
              -DCMAKE_CXX_FLAGS=$COMPILER_FLAGS \
              -DWITH_SAFEMALLOC=0 \
              -DWITH_WSREP=0 \
              -DWITH_UNIT_TESTS=0 \
              -DWITH_UNITTEST=0 \
              -DWITH_CLIENT=0 \
              -DWITH_ZLIB=system \
              -DWITHOUT_ROCKSDB_STORAGE_ENGINE=1 \
              -DWITHOUT_MROONGA_STORAGE_ENGINE=1 \
              -DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
              -DWITHOUT_CONNECT_STORAGE_ENGINE=1 \
              -DWITHOUT_SPHINX_STORAGE_ENGINE=1 \
              -DWITHOUT_TOKUDB_STORAGE_ENGINE=1 \
              -DWITHOUT_SPIDER_STORAGE_ENGINE=1 \
              -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
              ../server
           
          ninja -j4
           
          cd mysql-test
          ./mtr -mem -par=auto
          

          I also attach a sample output. 91 warnings total. sample_tsan_output

          kevg Eugene Kosov (Inactive) added a comment - Here is a simple script to use TSAN. #!/bin/bash   git clone --depth=1 --recurse-submodules git@github.com:MariaDB /server .git server   mkdir debug_build cd debug_build   COMPILER_FLAGS= "-fdiagnostics-color -fno-omit-frame-pointer -gsplit-dwarf" cmake \ -G Ninja \ -DWITH_TSAN=1 \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_FLAGS=$COMPILER_FLAGS \ -DCMAKE_CXX_FLAGS=$COMPILER_FLAGS \ -DWITH_SAFEMALLOC=0 \ -DWITH_WSREP=0 \ -DWITH_UNIT_TESTS=0 \ -DWITH_UNITTEST=0 \ -DWITH_CLIENT=0 \ -DWITH_ZLIB=system \ -DWITHOUT_ROCKSDB_STORAGE_ENGINE=1 \ -DWITHOUT_MROONGA_STORAGE_ENGINE=1 \ -DWITHOUT_PARTITION_STORAGE_ENGINE=1 \ -DWITHOUT_CONNECT_STORAGE_ENGINE=1 \ -DWITHOUT_SPHINX_STORAGE_ENGINE=1 \ -DWITHOUT_TOKUDB_STORAGE_ENGINE=1 \ -DWITHOUT_SPIDER_STORAGE_ENGINE=1 \ -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ .. /server   ninja -j4   cd mysql- test . /mtr -mem -par=auto I also attach a sample output. 91 warnings total. sample_tsan_output

          And I have a recent gcc:
          gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0

          kevg Eugene Kosov (Inactive) added a comment - And I have a recent gcc: gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0
          danblack Daniel Black added a comment -

          Reuse the MDBF-793 as a up to date clang worker image.

          danblack Daniel Black added a comment - Reuse the MDBF-793 as a up to date clang worker image.
          danblack Daniel Black added a comment -

          export TSAN_OPTIONS=suppress_equal_stacks=1:suppress_equal_addresses=1:history_size=7:verbosity=1
          

          danblack Daniel Black added a comment - export TSAN_OPTIONS=suppress_equal_stacks=1:suppress_equal_addresses=1:history_size=7:verbosity=1

          People

            danblack Daniel Black
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: