List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:February 19 2008 9:44pm
Subject:Re: bk commit into 5.1 tree (davi:1.2553) BUG#34424
View as plain text  
Hi Sergei,

Sergei Golubchik wrote:
> Hi!
> 
> On Feb 18, Davi Arnaut wrote:
>> ChangeSet@stripped, 2008-02-18 10:18:07-03:00, davi@stripped +4 -0
>>   Bug#34424 query_cache_debug.test leads to valgrind warnings
>>   
>>   The problem is that the per-thread debugging settings stack wasn't
>>   being deallocated before the thread termination, leaking the stack
>>   memory. The solution is to free the per-thread debugging settings
>>   stack once the thread finishes.
> 
> What's wrong with DBUG_POP() as a cleanup, why do you need a special
> function for this ?

We need a special function because in this very some situation a paired
DBUG_POP() is not possible (might be possible, but in a very different
place).

> Note that it's ok to have a warning if DBUG_PUSH and DBUG_POP are not
> paired, no need to fix that. The memory leak comes from DBUG_PUSH that
> doesn't have a matching DBUG_POP. Using DBUG_POP as a cleanup seems
> appropriate.

Of course it comes from a DBUG_POP, but calling DBUG_POP unconditionally
is the same as cleaning up the house after the thread has been finished.
 Also it's a pity to have to set and restore the session debug variable.

Regards,

-- 
Davi Arnaut, Software Engineer
MySQL Inc, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification
Thread
bk commit into 5.1 tree (davi:1.2553) BUG#34424Davi Arnaut18 Feb
  • Re: bk commit into 5.1 tree (davi:1.2553) BUG#34424Sergei Golubchik19 Feb
    • Re: bk commit into 5.1 tree (davi:1.2553) BUG#34424Davi Arnaut19 Feb