From: Jon Olav Hauglid Date: October 12 2012 2:48pm Subject: bzr push into mysql-5.6 branch (jon.hauglid:4456 to 4458) Bug#13945257 List-Archive: http://lists.mysql.com/commits/145034 X-Bug: 13945257 Message-Id: <20121012144838.12923.179.4458@atum08.no.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4458 Jon Olav Hauglid 2012-10-12 Bug#13945257 NEW COMPILATION ERRORS/WARNINGS WITH XCODE 4.3.2 Follow-up patch: Fix 2 additional warnings reported by Clang 4.1 / XCode 4.5.1 modified: sql/item_func.h sql/log_event.cc 4457 Jon Olav Hauglid 2012-10-12 Bug#14741880: Sporadic query cache related crash in pthread_rwlock_init() Bug 67156: Sporadic query cache related crash in pthread_rwlock_init() Reinitializing the query cache might lead to a crash inside pthread_rwlock_init() on Mac OS X. Mac OS X's pthread_rwlock_init() implements a check to detect attempts to reinitialize a previously initialized but not yet destroyed read/write lock. This check works by looking for a signature within the rwlock object and, if the signature matches, some pointer variables within the object are dereferenced. When MySQL's query cache is resized (e.g. SET query_cache_size = ...), or simply deinitialized, the memory used to allocate blocks is freed without explicitly deinitializing the allocated blocks. In particular, 'queries blocks' contain rwlock objects that are not properly destroyed. If the query cache is resized, and the same memory region is used, and a new query block is allocated in the same position, attempting to initialize the block's read/write lock might crash if the read-write lock object signature was preserved but yet somehow some of its fields were corrupted. The solution is to properly destroy the used read-write lock objects. modified: sql/sql_cache.cc 4456 joerg.bruehe@stripped 2012-10-12 Raise version number after cloning 5.6.8-rc modified: VERSION === modified file 'sql/item_func.h' --- a/sql/item_func.h 2012-10-10 13:52:42 +0000 +++ b/sql/item_func.h 2012-10-12 14:27:31 +0000 @@ -1686,7 +1686,7 @@ public: Item_func_set_user_var(THD *thd, Item_func_set_user_var *item) :Item_var_func(thd, item), cached_result_type(item->cached_result_type), entry(item->entry), entry_thread_id(item->entry_thread_id), - delayed_non_constness(delayed_non_constness), value(item->value), + delayed_non_constness(item->delayed_non_constness), value(item->value), decimal_buff(item->decimal_buff), null_item(item->null_item), save_result(item->save_result), name(item->name) {} === modified file 'sql/log_event.cc' --- a/sql/log_event.cc 2012-10-10 13:52:42 +0000 +++ b/sql/log_event.cc 2012-10-12 14:27:31 +0000 @@ -13332,7 +13332,7 @@ size_t my_strmov_quoted_identifier_helpe if (q == EOF) { - (void *) strncpy(buffer, identifier, id_length); + (void) strncpy(buffer, identifier, id_length); return id_length; } quote_char= (char) q; === modified file 'sql/sql_cache.cc' --- a/sql/sql_cache.cc 2012-10-03 12:51:45 +0000 +++ b/sql/sql_cache.cc 2012-10-12 14:04:45 +0000 @@ -1136,7 +1136,7 @@ ulong Query_cache::resize(ulong query_ca { BLOCK_LOCK_WR(block); Query_cache_query *query= block->query(); - if (query && query->writer()) + if (query->writer()) { /* Drop the writer; this will cancel any attempts to store @@ -1146,7 +1146,7 @@ ulong Query_cache::resize(ulong query_ca query->writer(0); refused++; } - BLOCK_UNLOCK_WR(block); + query->unlock_n_destroy(); block= block->next; } while (block != queries_blocks); } No bundle (reason: useless for push emails).