From 8678a1052d5d4c2f2c7ac7f9ae4dff0c3030824b Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 7 Mar 2019 11:33:42 +1100 Subject: [PATCH] MDEV-18946: innodb: buffer_pool - unallocate large pages requires size MDEV-10814 introduce a bug where the size argument to deallocate_large was passed true, evaluating to 1, as the size. When this is passed to munmap this resulted in EINVAL and the page not being released. This only occured the buf_pool_free_instance when called on shutdown so no impact as the process termination correctly frees the memory. --- storage/innobase/buf/buf0buf.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 0960a3e84ce63..6ff0bd1de0cfe 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -2015,7 +2015,7 @@ buf_pool_free_instance( } buf_pool->allocator.deallocate_large( - chunk->mem, &chunk->mem_pfx, true); + chunk->mem, &chunk->mem_pfx, chunk->mem_size(), true); } for (ulint i = BUF_FLUSH_LRU; i < BUF_FLUSH_N_TYPES; ++i) { @@ -2893,7 +2893,7 @@ buf_pool_resize() } buf_pool->allocator.deallocate_large( - chunk->mem, &chunk->mem_pfx, true); + chunk->mem, &chunk->mem_pfx, chunk->mem_size(), true); sum_freed += chunk->size;