[MDEV-3506] LP:782223 - Query_cache::resize() frees memory containing active locks Created: 2011-05-13  Updated: 2015-02-02  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug782223.xml    

 Description   

Found when investigating Windows application verifier errors (application verifier is sort-of valgrind).

The callstack leading of "free" containing critical section is:
mysqld!free
my_no_flags_free
Query_cache::free_cache
Query_cache::resize
fix_query_cache_size
set_var::update
sql_set_variables
mysql_execute_command
mysql_parse

The callstack of critical section allocation is :
pthread_cond_init
my_rwlock_init
Query_cache_query::init_n_lock
Query_cache::store_query
execute_sqlcom_select
mysql_execute_command
mysql_parse

Why freeing a heap block containing active critical section is bad

  • in the best case (the critical section is unlocked) it may lead to resource leakage, e.g underlying Windows event objects will be leaked.
  • in the worst case (critical section is locked) it could lead to random hangs when the freed memory is again reused for another critical section


 Comments   
Comment by Vladislav Vaintroub [ 2011-06-16 ]

Re: Query_cache::resize() frees memory containing active locks
Release in 5.2.7

Comment by Rasmus Johansson (Inactive) [ 2011-06-16 ]

Launchpad bug id: 782223

Generated at Thu Feb 08 06:49:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.