Commit 453dc4b3 authored by Marko Mäkelä's avatar Marko Mäkelä

Fixup the parent commit for MSAN and Valgrind

commit 48493132 was a necessary
fix for the buffer pool resizing tests in 10.5 in
AddressSanitizer. However, that change would break the tests
innodb.innodb_buffer_pool_resize and
innodb.innodb_buffer_pool_resize_with_chunks
when run in MemorySanitizer, or presumably in Valgrind as well.
(Those tests run "forever" in Valgrind.)

buf_pool_resize(): Cancel the effect of MEM_NOACCESS() in Valgrind
and ASAN. In MSAN, MEM_NOACCESS() is a no-op, and hence we must do
nothing special here.

MEM_MAKE_ADDRESSABLE() would declare the memory contents undefined.
In this particular case, we must actually declare the contents
defined for Valgrind.
parent 48493132
......@@ -1622,7 +1622,7 @@ buf_chunk_init(
return(NULL);
}
MEM_MAKE_ADDRESSABLE(chunk->mem, chunk->mem_size());
MEM_MAKE_ADDRESSABLE(chunk->mem, chunk->mem_size());
#ifdef HAVE_LIBNUMA
if (srv_numa_interleave) {
......@@ -2910,8 +2910,21 @@ buf_pool_resize()
while (chunk < echunk) {
buf_block_t* block = chunk->blocks;
MEM_MAKE_ADDRESSABLE(chunk->mem,
chunk->mem_size());
/* buf_LRU_block_free_non_file_page()
invokes MEM_NOACCESS() on any blocks
that are in free_list. We must
cancel the effect of that. In MemorySanitizer,
MEM_NOACCESS() is no-op, so we must not do
anything special for it here. */
#ifdef HAVE_valgrind
# if !__has_feature(memory_sanitizer)
MEM_MAKE_DEFINED(chunk->mem,
chunk->mem_size());
# endif
#else
MEM_MAKE_ADDRESSABLE(chunk->mem,
chunk->mem_size());
#endif
for (ulint j = chunk->size;
j--; block++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment