From 567a1246aa437512447d48ef96b48eb37735aa67 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 31 May 2010 18:23:41 +0300 Subject: [PATCH] Fix Bug #53947 InnoDB: Assertion failure in thread 4224 in file .\sync\sync0sync.c line 324 Destroy the rw-lock object before freeing the memory it is occupying. If we do not do this, then the mutex that is contained in the rw-lock object btr_search_latch_temp->mutex gets "freed" and subsequently mutex_free() from sync_close() hits a mutex whose memory has been freed and crashes. Approved by: Heikki (via IRC) Discussed with: Calvin --- storage/innobase/btr/btr0sea.c | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c index 3f130405810..98a321bdb80 100644 --- a/storage/innobase/btr/btr0sea.c +++ b/storage/innobase/btr/btr0sea.c @@ -194,6 +194,7 @@ void btr_search_sys_free(void) /*=====================*/ { + rw_lock_free(&btr_search_latch); mem_free(btr_search_latch_temp); btr_search_latch_temp = NULL; mem_heap_free(btr_search_sys->hash_index->heap);