1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-07 17:42:39 +03:00
Files
mariadb/sql
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
..
2019-05-14 17:18:46 +03:00
2019-05-13 17:54:04 +03:00
2020-03-23 09:22:29 +01:00
2019-05-19 20:55:37 +02:00
2019-05-19 20:55:37 +02:00
2019-05-11 22:19:05 +03:00
2019-05-14 17:18:46 +03:00
2019-05-11 21:29:06 +03:00
2019-05-19 20:55:37 +02:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-11 21:29:06 +03:00
2020-03-16 00:10:50 +02:00
2020-03-20 22:06:55 +02:00
2019-05-13 17:54:04 +03:00
2019-05-14 17:18:46 +03:00
2019-05-13 17:54:04 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2020-03-24 20:47:41 +02:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-19 20:55:37 +02:00
2019-05-19 20:55:37 +02:00
2019-05-19 20:55:37 +02:00
2020-02-27 18:12:47 +04:00
2020-03-11 17:52:49 +01:00
2019-05-19 20:55:37 +02:00
2019-12-27 21:17:16 +02:00
2020-03-16 00:10:50 +02:00
2020-01-28 14:17:09 +02:00
2019-04-02 11:04:54 +03:00
2019-12-27 21:17:16 +02:00
2019-05-14 17:18:46 +03:00
2019-10-18 09:05:27 +03:00
2019-05-11 21:29:06 +03:00
2020-03-24 21:00:04 +02:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2020-03-24 21:00:03 +02:00
2019-05-11 21:29:06 +03:00
2020-03-11 17:52:49 +01:00
2019-05-19 20:55:37 +02:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00
2019-06-25 13:21:36 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2020-02-11 14:40:35 +01:00
2020-02-11 14:40:35 +01:00
2020-03-27 09:39:15 +02:00
2019-12-16 07:47:17 +02:00
2019-05-11 21:29:06 +03:00
2020-03-23 10:50:14 +02:00
2019-09-27 19:12:07 +03:00
2020-03-11 17:52:49 +01:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-06-25 13:21:36 +03:00
2019-05-14 17:18:46 +03:00
2019-05-19 20:55:37 +02:00
2019-05-14 17:18:46 +03:00
2019-02-14 15:23:23 -08:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2020-03-23 10:50:14 +02:00
2019-05-19 20:55:37 +02:00
2020-03-27 09:39:15 +02:00
2019-05-11 22:19:05 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2020-03-27 09:39:15 +02:00
2019-05-11 22:19:05 +03:00
2019-05-23 10:32:21 +03:00
2020-03-10 19:24:24 +01:00
2020-03-27 09:39:15 +02:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2020-03-21 11:37:10 +02:00
2019-05-19 20:55:37 +02:00
2020-03-16 00:10:50 +02:00
2019-05-14 17:18:46 +03:00
2020-03-16 00:10:50 +02:00
2019-05-14 17:18:46 +03:00
2020-03-16 00:10:50 +02:00
2020-03-21 11:37:10 +02:00
2020-03-21 11:37:10 +02:00
2019-05-14 17:18:46 +03:00
2019-04-02 12:00:04 +03:00
2020-03-03 13:50:33 +03:00
2019-05-19 20:55:37 +02:00
2019-05-14 17:18:46 +03:00
2019-12-27 15:14:48 +02:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00
2019-05-11 19:25:02 +03:00
2019-05-14 17:18:46 +03:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00
2019-05-23 10:32:21 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-19 20:55:37 +02:00
2019-05-11 19:25:02 +03:00
2019-05-14 17:18:46 +03:00
2019-05-19 20:55:37 +02:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00
2019-05-11 19:25:02 +03:00
2019-05-19 20:55:37 +02:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00
2020-03-16 00:10:50 +02:00
2020-03-24 21:00:02 +02:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-11 21:29:06 +03:00
2020-03-27 09:39:15 +02:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-07-02 17:46:22 +03:00
2019-05-14 17:18:46 +03:00
2020-03-11 17:52:49 +01:00
2019-05-11 22:19:05 +03:00
2020-03-24 21:00:02 +02:00
2019-05-19 20:55:37 +02:00
2019-05-14 17:18:46 +03:00
2020-03-11 17:52:49 +01:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-10-10 11:19:25 +03:00
2019-05-11 21:29:06 +03:00
2020-03-11 17:52:49 +01:00
2019-05-19 20:55:37 +02:00
2020-03-16 16:24:36 +02:00
2019-05-14 17:18:46 +03:00
2019-05-11 22:19:05 +03:00
2019-12-16 07:47:17 +02:00
2020-03-21 11:37:10 +02:00
2020-03-20 22:06:55 +02:00
2019-05-19 20:55:37 +02:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-14 17:18:46 +03:00
2019-05-28 14:54:38 +04:00
2020-03-24 21:00:04 +02:00
2019-05-14 17:18:46 +03:00
2020-03-23 10:50:14 +02:00
2020-03-23 10:50:14 +02:00
2019-09-12 16:36:46 +03:00
2019-05-19 20:55:37 +02:00
2019-05-11 21:29:06 +03:00
2019-05-14 17:18:46 +03:00
2019-05-19 20:55:37 +02:00
2019-05-14 17:18:46 +03:00
2019-05-10 20:52:00 +03:00
2020-01-29 15:06:06 +02:00
2020-03-21 11:37:10 +02:00
2019-11-07 08:52:30 +01:00
2019-01-23 15:30:00 +04:00
2019-01-23 15:30:00 +04:00
2019-01-23 15:30:00 +04:00
2019-05-11 19:25:02 +03:00
2019-05-19 20:55:37 +02:00
2019-05-19 20:55:37 +02:00
2020-01-29 15:06:06 +02:00
2020-03-11 13:27:10 +01:00
2020-03-21 11:37:10 +02:00
2019-01-23 15:30:00 +04:00
2019-05-19 20:55:37 +02:00
2020-01-29 15:06:06 +02:00
2020-03-28 21:20:29 +02:00
2020-01-29 15:06:06 +02:00