Bug #11034 Valgrind warning in DictCache::get, memory loss
Submitted: 2 Jun 2005 15:14 Modified: 12 Apr 2006 1:05
Reporter: Magnus Blaudd
Status: Closed
Category:Server: Cluster Severity:S3 (Non-critical)
Version:5.0.7 OS:
Assigned to: Jonas Oreland Target Version:

[2 Jun 2005 15:14] Magnus Blaudd
Description:
Memory is allocated in GlobalDictCache::get which is never freed. 

==14653== 64 bytes in 2 blocks are indirectly lost in loss record 4 of 12
==14653==    at 0x1B905222: malloc (vg_replace_malloc.c:130)
==14653==    by 0x84F9488: operator new[](unsigned) (my_new.cc:33)
==14653==    by 0x849E1B0: Vector<GlobalDictCache::TableVersion>::Vector(int)
(Vector.hpp:55)
==14653==    by 0x849D20F: GlobalDictCache::get(char const*) (DictCache.cpp:147)==14653==
   by 0x84572C7: NdbDictionaryImpl::fetchGlobalTableImpl(BaseString const&)
(BaseString.hpp:193)
==14653==    by 0x844279E: NdbDictionaryImpl::get_local_table_info(BaseString const&,
bool) (NdbDictionaryImpl.hpp:661)
==14653==    by 0x84503CD: NdbDictionary::Dictionary::invalidateTable(char const*)
(NdbDictionaryImpl.hpp:644)
==14653==    by 0x827CEB9: ndbcluster_discover(THD*, char const*, char const*, void
const**, unsigned*) (ha_ndbcluster.cc:4444)
==14653==    by 0x8255615: ha_discover(THD*, char const*, char const*, void const**,
unsigned*) (handler.cc:2064)
==14653==    by 0x8255057: ha_create_table_from_engine(THD*, char const*, char const*,
bool) (handler.cc:1916)
==14653==    by 0x828BFA4: mysql_create_table(THD*, char const*, char const*,
st_ha_create_information*, List<create_field>&, List<Key>&, bool, unsigned)
(sql_table.cc:1591)
==14653==    by 0x81AC5C3: mysql_execute_command(THD*) (sql_parse.cc:2834)
==14653==    by 0x81B334C: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:5252)
==14653==    by 0x81A96A5: dispatch_command(enum_server_command, THD*, char*, unsigned)
(sql_parse.cc:1651)
==14653==    by 0x81A8F8C: do_command(THD*) (sql_parse.cc:1454)
==14653==    by 0x81A8191: handle_one_connection (sql_parse.cc:1114)
==14653==
==14653==
==14653== 96 (32 direct, 64 indirect) bytes in 2 blocks are definitely lost in loss
record 5 of 12
==14653==    at 0x1B905222: malloc (vg_replace_malloc.c:130)
==14653==    by 0x84F946A: operator new(unsigned) (my_new.cc:28)
==14653==    by 0x849D1FD: GlobalDictCache::get(char const*) (DictCache.cpp:147)==14653==
   by 0x84572C7: NdbDictionaryImpl::fetchGlobalTableImpl(BaseString const&)
(BaseString.hpp:193)
==14653==    by 0x8450676: NdbDictionary::Dictionary::getIndex(char const*, char const*)
const (NdbDictionaryImpl.hpp:661)
==14653==    by 0x8270338: ha_ndbcluster::build_index_list(Ndb*, st_table*,
ha_ndbcluster::ILBP) (ha_ndbcluster.cc:1067)
==14653==    by 0x827B148: ha_ndbcluster::create(char const*, st_table*,
st_ha_create_information*) (ha_ndbcluster.cc:3979)
                                                              397,1         15%

How to repeat:
mysql-test-run --do-test=ndb_auto --valgrind
[7 Apr 2006 17:13] 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/4649
[9 Apr 2006 23:14] Jonas Oreland
pushed into 5.1.10
[10 Apr 2006 10:17] Jonas Oreland
pushed into 5.0.21
[12 Apr 2006 1:05] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 5.1.10 and 5.0.21 changelogs. Closed.