Bug #55506 Memory leak on partition_error.test
Submitted: 23 Jul 2010 11:45 Modified: 25 Jul 2010 2:59
Reporter: Libing Song Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any

[23 Jul 2010 11:45] Libing Song
Description:
Valgrind said there was memory leak on partition_error.test. The memory leak only happened when I add '--source include/restart_mysqld.inc' to the end of the test. 

This problem results the failure of server_uuid.test on mysql-5.1-rep+2. As server_uuid restarts the server manually.

------------------------------------------------------------
==17340==
==17340== HEAP SUMMARY:
==17340==     in use at exit: 312 bytes in 2 blocks
==17340==   total heap usage: 41,401 allocs, 41,399 frees, 104,527,830 bytes allocated
==17340==
==17340== 40 bytes in 1 blocks are definitely lost in loss record 1 of 2
==17340==    at 0x4C284A8: malloc (vg_replace_malloc.c:236)
==17340==    by 0xA5075D: my_malloc (my_malloc.c:38)
==17340==    by 0x6558C9: String::real_alloc(unsigned int) (sql_string.cc:41)
==17340==    by 0x556FE8: String::alloc(unsigned int) (sql_string.h:217)
==17340==    by 0x7ED21E: Item_extract::fix_length_and_dec() (item_timefunc.cc:2341)
==17340==    by 0x7A2342: Item_func::fix_fields(THD*, Item**) (item_func.cc:219)
==17340==    by 0x889A13: fix_fields_part_func(THD*, Item*, TABLE*, bool, bool) (sql_partition.cc:1108)
==17340==    by 0x88AD0D: fix_partition_func(THD*, TABLE*, bool) (sql_partition.cc:1810)
==17340==    by 0x68DC87: open_table_from_share(THD*, TABLE_SHARE*, char const*, unsigned int, unsigned int, unsigned int, TABLE*, bool) (table.cc:1900)
==17340==    by 0x7572EC: ha_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, bool) (handler.cc:3599)
==17340==    by 0x69E6B1: rea_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, List<Create_field>&, unsigned int, st_key*, handler*) (unireg.cc:463)
==17340==    by 0x662D3F: mysql_create_table_no_lock(THD*, char const*, char const*, st_ha_create_information*, Alter_info*, bool, unsigned int) (sql_table.cc:4179)
==17340==    by 0x66AFD5: mysql_alter_table(THD*, char*, char*, st_ha_create_information*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool) (sql_table.cc:7171)
==17340==    by 0x5DE4EA: mysql_execute_command(THD*) (sql_parse.cc:2912)
==17340==    by 0x5E6B59: mysql_parse(THD*, char const*, unsigned int, Parser_state*) (sql_parse.cc:5901)
==17340==    by 0x5DA4ED: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1135)
==17340==
==17340== LEAK SUMMARY:
==17340==    definitely lost: 40 bytes in 1 blocks
==17340==    indirectly lost: 0 bytes in 0 blocks
==17340==      possibly lost: 0 bytes in 0 blocks
==17340==    still reachable: 0 bytes in 0 blocks
==17340==         suppressed: 272 bytes in 1 blocks

How to repeat:
Add the following code at the end of partition_error.test.

--source include/restart_mysqld.inc
[23 Jul 2010 14:20] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. How do you compile MySQL? How do you run tests? Which version of valgrind do you use?
[24 Jul 2010 9:11] MySQL Verification Team
Libing, are you sure this isn't the same as bug #46949
[25 Jul 2010 2:59] Libing Song
Shane Bester, It is the duplicate of bug#46946.
[26 Jul 2010 8:10] Libing Song
Correct the typo in last comment.

It is the duplicate of bug#46949.