mariadb/storage
Marko Mäkelä 94d0bb4dbe MDEV-20377: Make WITH_MSAN more usable
MemorySanitizer (clang -fsanitize=memory) requires that all code
be compiled with instrumentation enabled. The C runtime library
is an exception. Failure to use instrumented libraries will cause
bogus messages about memory being uninitialized.

In WITH_MSAN builds, we must avoid calling getservbyname(),
because even though it is a standard library function, it is
not instrumented, not even in clang 10.

The following cmake options were tested:

-DCMAKE_C_FLAGS='-march=native -O2'
-DCMAKE_CXX_FLAGS='-stdlib=libc++ -march=native -O2'
-DWITH_EMBEDDED_SERVER=OFF -DWITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug
-DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF
-DPLUGIN_{ARCHIVE,TOKUDB,MROONGA,OQGRAPH,ROCKSDB,CONNECT,SPIDER}=NO
-DWITH_SAFEMALLOC=OFF
-DWITH_{ZLIB,SSL,PCRE}=bundled
-DHAVE_LIBAIO_H=0
-DWITH_MSAN=ON

MEM_MAKE_DEFINED(): An alias for VALGRIND_MAKE_MEM_DEFINED()
and in the future, __msan_unpoison().

For now, neither MEM_MAKE_DEFINED() nor MEM_UNDEFINED()
perform any action under MSAN. Enabling them will catch more bugs, but
will also require some more fixes or work-arounds.

Json_writer::add_double(): Work around a frequently occurring
failure in optimizer tests, related to EXPLAIN FORMAT=JSON.

dtoa(): Disable MSAN altogether. For some reason, this function
is triggering a lot of trouble, especially when invoked for
DBUG functions. The MDL default timeout is dd=86400 seconds,
and for some reason it is claimed to be uninitialized.

InnoDB: Define UNIV_DEBUG_VALGRIND also WITH_MSAN.

ut_crc32_8_hw(), ut_crc32_64_low_hw(): Use the compiler built-in
functions instead of inline assembler when building WITH_MSAN.
This will require at least -msse4.2 when building for IA-32 or AMD64.
The inline assembler would not be instrumented, and would thus cause
bogus failures.
2020-03-28 21:36:30 +02:00
..
archive perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
blackhole cleanup: PSI key is *always* the first argument 2020-03-10 19:24:23 +01:00
cassandra Fixed failing tests in buildbot 2020-03-27 12:30:10 +02:00
connect Updated optimizer costs in multi_range_read_info_const() and sql_select.cc 2020-03-27 03:58:32 +02:00
csv cleanup: PSI key is *always* the first argument 2020-03-10 19:24:23 +01:00
example Added page_range to records_in_range() to improve range statistics 2020-03-27 03:54:45 +02:00
federated Added page_range to records_in_range() to improve range statistics 2020-03-27 03:54:45 +02:00
federatedx Merge 10.4 into 10.5 2020-03-27 09:39:15 +02:00
heap Updated optimizer costs in multi_range_read_info_const() and sql_select.cc 2020-03-27 03:58:32 +02:00
innobase MDEV-20377: Make WITH_MSAN more usable 2020-03-28 21:36:30 +02:00
maria MDEV-20329 Fix S3 engine OpenSSL race 2020-03-27 13:02:02 +02:00
mroonga Updated optimizer costs in multi_range_read_info_const() and sql_select.cc 2020-03-27 03:58:32 +02:00
myisam Updated optimizer costs in multi_range_read_info_const() and sql_select.cc 2020-03-27 03:58:32 +02:00
myisammrg Added page_range to records_in_range() to improve range statistics 2020-03-27 03:54:45 +02:00
oqgraph Added page_range to records_in_range() to improve range statistics 2020-03-27 03:54:45 +02:00
perfschema Merge 10.4 into 10.5 2020-03-23 10:50:14 +02:00
rocksdb Updated optimizer costs in multi_range_read_info_const() and sql_select.cc 2020-03-27 03:58:32 +02:00
sequence Added page_range to records_in_range() to improve range statistics 2020-03-27 03:54:45 +02:00
sphinx Added page_range to records_in_range() to improve range statistics 2020-03-27 03:54:45 +02:00
spider Updated optimizer costs in multi_range_read_info_const() and sql_select.cc 2020-03-27 03:58:32 +02:00
test_sql_discovery MDEV-19944 Remove GIS data types from keyword list in lex.h 2019-07-04 07:48:46 +04:00
tokudb Updated optimizer costs in multi_range_read_info_const() and sql_select.cc 2020-03-27 03:58:32 +02:00