summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-03-30 18:42:28 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-04-07 16:42:09 +0530
commit72da83ff99860878fc28a1f26bfd893baa153368 (patch)
tree2ab6f964075ff9273a5a3ca1f1dde29a1e971492 /storage
parent82a2ea64b47ba7d4f10019418f84a0f3131d1c11 (diff)
downloadmariadb-git-72da83ff99860878fc28a1f26bfd893baa153368.tar.gz
MDEV-25019 memory allocation failures during startup becausebb-10.2-MDEV-25019
server failure in different, confusing ways InnoDB fails to free the buffer pool instance mutex and zip mutex If the allocation of buffer pool instance chunk fails. So it leads to freeing of buffer pool before freeing the mutexes and leads to double freeing of memory while freeing the mutex during shutdown.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/buf/buf0buf.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 9f3d743ada1..070789288b6 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1864,6 +1864,10 @@ buf_pool_init_instance(
ut_free(buf_pool->chunks);
buf_pool_mutex_exit(buf_pool);
+ /* InnoDB should free the mutex which was
+ created so far before freeing the instance */
+ mutex_free(&buf_pool->mutex);
+ mutex_free(&buf_pool->zip_mutex);
return(DB_ERROR);
}