diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-28 21:05:55 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-28 21:42:59 +0200 |
commit | 6be56dd1c8a37eb98f4b7bc1507ca5991a2a1f61 (patch) | |
tree | a981e1d7a6ff9dbb6b7bbbceb4380ccccf660c55 | |
parent | 94d0bb4dbeb28a94d1f87fdd55f4297ff3df0157 (diff) | |
download | mariadb-git-bb-10.5-msan.tar.gz |
MDEV-20377: Enable MemorySanitizer user-poisoningbb-10.5-msan
For ENGINE=Aria, we work around bugs in various tests that catch
writes of uninitialized bytes from the Aria page cache.
(Why do we even write anything on DROP TABLE?)
-rw-r--r-- | include/my_valgrind.h | 9 | ||||
-rw-r--r-- | storage/maria/ma_pagecache.c | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/include/my_valgrind.h b/include/my_valgrind.h index 3f172831e51..2c623a044f4 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -50,13 +50,8 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */ # define REDZONE_SIZE 8 #elif __has_feature(memory_sanitizer) # include <sanitizer/msan_interface.h> -# if 0 /* FIXME: these reveal lots of failures */ -# define MEM_UNDEFINED(a,len) __msan_allocated_memory(a,len) -# define MEM_MAKE_DEFINED(a,len) __msan_unpoison(a,len) -# else -# define MEM_UNDEFINED(a,len) ((void) 0) -# define MEM_MAKE_DEFINED(a,len) ((void) 0) -# endif +# define MEM_UNDEFINED(a,len) __msan_allocated_memory(a,len) +# define MEM_MAKE_DEFINED(a,len) __msan_unpoison(a,len) # define MEM_NOACCESS(a,len) ((void) 0) # define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) # define MEM_CHECK_DEFINED(a,len) __msan_check_mem_is_initialized(a,len) diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index e08c18fb579..8fa6646048d 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -681,6 +681,10 @@ static my_bool pagecache_fwrite(PAGECACHE *pagecache, DBUG_PRINT("error", ("write callback problem")); DBUG_RETURN(1); } +#if __has_feature(memory_sanitizer) /* FIXME: encryption.aria_tiny etc. fail */ + /* FIXME: ENGINE=Aria occasionally writes uninitialized data */ + __msan_unpoison(args.page, pagecache->block_size); +#endif res= (int)my_pwrite(filedesc->file, args.page, pagecache->block_size, ((my_off_t) pageno << pagecache->shift), flags); (*filedesc->post_write_hook)(res, &args); |