Fixup the parent commit for MSAN and Valgrind
commit 484931325e7bcecddc6daf1a55c008ddd67497e4 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.
This commit is contained in:
parent
484931325e
commit
453dc4b300
@ -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 @@ withdraw_retry:
|
||||
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++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user