Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-37440

MSAN use-of-uninitialized-value in make_progress_string() in WSREP prevents server startup

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      During a simple startup of mariadbd:

      /test/MSAN_MD140825-mariadb-11.8.4-linux-x86_64-opt $ ./bin/mariadbd --no-defaults --max_connections=10000 --core-file --basedir=${PWD} --tmpdir=./tmp --datadir=./data --socket=./socket.sock --port=$PORT --log-error=./log/master.err --server-id=100 2>&1 &
      

      We see an MSAN use-of-uninitialized-value in WSREP code:

      CS 11.8.4 1a446ccc48528e88a3cd6cd1d1ec9e7492d342ca (Optimized, MSAN, Clang) Build 14/08/2025

      ==12726==WARNING: MemorySanitizer: use-of-uninitialized-value
          #0 0x591b950b0e13 in std::__1::basic_ostream<char, std::__1::char_traits<char>>& std::__1::__put_character_sequence[abi:ne180100]<char, std::__1::char_traits<char>>(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, char const*, unsigned long) /usr/lib/llvm-18/bin/../include/c++/v1/ostream:672:9
          #1 0x591b95f93e99 in std::__1::basic_ostream<char, std::__1::char_traits<char>>& std::__1::operator<<[abi:ne180100]<std::__1::char_traits<char>>(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, char const*) /usr/lib/llvm-18/bin/../include/c++/v1/ostream:787:10
          #2 0x591b95f93e99 in make_progress_string(int, int, int, int, int) /test/11.8_opt_san/wsrep-lib/src/reporter.cpp:43:8
          #3 0x591b95fa1c54 in __cxx_global_var_init.1 /test/11.8_opt_san/wsrep-lib/src/reporter.cpp:53:6
          #4 0x591b95fa1c54 in _GLOBAL__sub_I_reporter.cpp /test/11.8_opt_san/wsrep-lib/src/reporter.cpp
          #5 0x7b658cc2a303 in call_init csu/../csu/libc-start.c:145:3
          #6 0x7b658cc2a303 in __libc_start_main csu/../csu/libc-start.c:347:5
          #7 0x591b93a84074 in _start (/test/MSAN_MD140825-mariadb-11.8.4-linux-x86_64-opt/bin/mariadbd+0xef1074) (BuildId: 44ccef7946d1dd93)
       
        Uninitialized value was created by an allocation of '__s' in the stack frame
          #0 0x591b950b0b85 in std::__1::basic_ostream<char, std::__1::char_traits<char>>& std::__1::__put_character_sequence[abi:ne180100]<char, std::__1::char_traits<char>>(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, char const*, unsigned long) /usr/lib/llvm-18/bin/../include/c++/v1/ostream:671:5
       
      SUMMARY: MemorySanitizer: use-of-uninitialized-value /test/11.8_opt_san/wsrep-lib/src/reporter.cpp:43:8 in make_progress_string(int, int, int, int, int)
      

      Environment & cmake command

      Ubuntu 24.04 LTS, Clang/LLVM 18.1.3, MSAN instrumented system libs, MSAN_OPTIONS=abort_on_error=1:poison_in_dtor=0
       
      cmake . -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DWITH_SSL=bundled -DBUILD_CONFIG=mysql_release -DWITH_TOKUDB=0 -DWITH_JEMALLOC=no -DFEATURE_SET=community -DDEBUG_EXTNAME=OFF -DWITH_EMBEDDED_SERVER=0 -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp/boost_582247 -DENABLED_LOCAL_INFILE=1 -DENABLE_DTRACE=0 -DWITH_{SAFEMALLOC,NUMA}=OFF -DWITH_UNIT_TESTS=OFF -DCONC_WITH_{UNITTEST,SSL}=OFF -DPLUGIN_PERFSCHEMA=NO -DWITH_DBUG_TRACE=OFF -DWITH_ZLIB=bundled -DWITH_ROCKSDB=1 -DWITH_PAM=ON -DWITH_MARIABACKUP=0 -DFORCE_INSOURCE_BUILD=1 -DWITH_MSAN=ON -DHAVE_CXX_NEW=1 -DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF -DWITH_NUMA=NO -DWITH_SYSTEMD=no -DPLUGIN_{MROONGA,ROCKSDB,OQGRAPH}=NO -DCMAKE_{EXE,MODULE}_LINKER_FLAGS="-L/MSAN_libs -Wl,-rpath=/MSAN_libs" -DCMAKE_C{,XX}_FLAGS='-O2 -march=native -mtune=native' -DMYSQL_MAINTAINER_MODE=OFF -DWARNING_AS_ERROR='' -DCMAKE_BUILD_TYPE=RelWithDebInfo
      

      Even with abort_on_error=0 the sever does not start. A fix would be appreciated. Likely other versions affected also.
      One possible workaround may be -DWITH_WSREP=NO.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.