mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
After-merge fix for ASAN and MSAN
The merge commit0fd89a1a89
of commitb6ec1e8bbf
seems to cause occasional MemorySanitizer failures, because it failed to replace some MEM_UNDEFINED() calls with MEM_MAKE_ADDRESSABLE(). my_large_free(): Correctly invoke MEM_MAKE_ADDRESSABLE() after freeing memory. Failure to do so could cause bogus AddressSanitizer failures for memory allocated by my_large_malloc(). On MemorySanitizer, we will do nothing. buf_pool_t::chunk_t::create(): Replace the MEM_MAKE_ADDRESSABLE() that had been added in commit484931325e
to work around the issue.
This commit is contained in:
parent
90d5d90640
commit
ab4069909d
2 changed files with 7 additions and 3 deletions
|
@ -421,9 +421,11 @@ void my_large_free(void *ptr, size_t size)
|
|||
{
|
||||
my_error(EE_BADMEMORYRELEASE, MYF(ME_ERROR_LOG_ONLY), ptr, size, errno);
|
||||
}
|
||||
# if !__has_feature(memory_sanitizer)
|
||||
else
|
||||
{
|
||||
MEM_UNDEFINED(ptr, size);
|
||||
MEM_MAKE_ADDRESSABLE(ptr, size);
|
||||
# endif
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
/*
|
||||
|
@ -435,9 +437,11 @@ void my_large_free(void *ptr, size_t size)
|
|||
my_error(EE_BADMEMORYRELEASE, MYF(ME_ERROR_LOG_ONLY), ptr, size,
|
||||
GetLastError());
|
||||
}
|
||||
# if !__has_feature(memory_sanitizer)
|
||||
else
|
||||
{
|
||||
MEM_UNDEFINED(ptr, size);
|
||||
MEM_MAKE_ADDRESSABLE(ptr, size);
|
||||
# endif
|
||||
}
|
||||
#else
|
||||
my_free_lock(ptr);
|
||||
|
|
|
@ -1356,7 +1356,7 @@ inline bool buf_pool_t::chunk_t::create(size_t bytes)
|
|||
if (UNIV_UNLIKELY(!mem))
|
||||
return false;
|
||||
|
||||
MEM_MAKE_ADDRESSABLE(mem, mem_size());
|
||||
MEM_UNDEFINED(mem, mem_size());
|
||||
|
||||
#ifdef HAVE_LIBNUMA
|
||||
if (srv_numa_interleave)
|
||||
|
|
Loading…
Add table
Reference in a new issue