Bug #21670 memory leak in ndb_mgm -e show
Submitted: 16 Aug 2006 6:32 Modified: 2 Sep 2006 6:18
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.0.25 OS:
Assigned to: Stewart Smith CPU Architecture:Any

[16 Aug 2006 6:32] Stewart Smith
Description:
==20398== 14,596 (11,936 direct, 2,660 indirect) bytes in 4 blocks are definitely lost in loss record 24 of 25
==20398==    at 0x401C4A1: malloc (vg_replace_malloc.c:149)
==20398==    by 0x80797A3: ConfigValuesFactory::create(unsigned, unsigned) (ConfigValues.cpp:309)
==20398==    by 0x8079F03: ConfigValuesFactory::expand(unsigned, unsigned) (ConfigValues.cpp:325)
==20398==    by 0x8079967: ConfigValuesFactory::put(ConfigValues::Entry const&) (ConfigValues.cpp:414)
==20398==    by 0x807A7B6: ConfigValuesFactory::unpack(void const*, unsigned) (ConfigValues.cpp:701)
==20398==    by 0x806CB9D: ConfigValuesFactory::unpack(UtilBuffer const&) (ConfigValues.hpp:252)
==20398==    by 0x8069160: ndb_mgm_get_configuration (mgmapi.cpp:1941)
==20398==    by 0x8060661: CommandInterpreter::executeShow(char*) (CommandInterpreter.cpp:1242)
==20398==    by 0x8063966: CommandInterpreter::execute_impl(char const*) (CommandInterpreter.cpp:715)
==20398==    by 0x8064040: CommandInterpreter::execute(char const*, int, int*) (CommandInterpreter.cpp:625)
==20398==    by 0x8064189: Ndb_mgmclient::execute(char const*, int, int*) (CommandInterpreter.cpp:203)
==20398==    by 0x805E56C: read_and_execute(int) (main.cpp:124)
==20398==    by 0x805E754: main (main.cpp:162)
==20398==

How to repeat:
ndb_mgm -e show (with valgrind)

Suggested fix:
correctly free the configuration
[16 Aug 2006 6:34] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/10522

ChangeSet@1.2248, 2006-08-16 14:33:31+08:00, stewart@willster.(none) +1 -0
  BUG#21670 memory leak in ndb_mgm -e show
  
  fix the following valgrind warning when running ndb_mgm -e show (leak only in client)
  
  ==20398== 14,596 (11,936 direct, 2,660 indirect) bytes in 4 blocks are definitely lost in loss record 24 of 25
  ==20398==    at 0x401C4A1: malloc (vg_replace_malloc.c:149)
  ==20398==    by 0x80797A3: ConfigValuesFactory::create(unsigned, unsigned) (ConfigValues.cpp:309)
  ==20398==    by 0x8079F03: ConfigValuesFactory::expand(unsigned, unsigned) (ConfigValues.cpp:325)
  ==20398==    by 0x8079967: ConfigValuesFactory::put(ConfigValues::Entry const&) (ConfigValues.cpp:414)
  ==20398==    by 0x807A7B6: ConfigValuesFactory::unpack(void const*, unsigned) (ConfigValues.cpp:701)
  ==20398==    by 0x806CB9D: ConfigValuesFactory::unpack(UtilBuffer const&) (ConfigValues.hpp:252)
  ==20398==    by 0x8069160: ndb_mgm_get_configuration (mgmapi.cpp:1941)
  ==20398==    by 0x8060661: CommandInterpreter::executeShow(char*) (CommandInterpreter.cpp:1242)
  ==20398==    by 0x8063966: CommandInterpreter::execute_impl(char const*) (CommandInterpreter.cpp:715)
  ==20398==    by 0x8064040: CommandInterpreter::execute(char const*, int, int*) (CommandInterpreter.cpp:625)
  ==20398==    by 0x8064189: Ndb_mgmclient::execute(char const*, int, int*) (CommandInterpreter.cpp:203)
  ==20398==    by 0x805E56C: read_and_execute(int) (main.cpp:124)
  ==20398==    by 0x805E754: main (main.cpp:162)
  ==20398==
[16 Aug 2006 7:39] Stewart Smith
pushed to 5.0-ndb and 5.1-ndb team trees.
[1 Sep 2006 8:08] Jonas Oreland
pushed to 5.1.12
[1 Sep 2006 19:30] Jonas Oreland
pushed to 5.0.25
[2 Sep 2006 6:18] Jon Stephens
Documented bugfix in 5.0.25/5.1.12 changelogs.