Bug #67641 Valgrind warnings on OPTIMIZE MyISAM TABLE with disabled keys
Submitted: 19 Nov 2012 21:48 Modified: 21 Nov 2012 14:32
Reporter: Elena Stepanova Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.5.27 OS:Linux (Ubuntu 11.10 x86_64)
Assigned to: CPU Architecture:Any

[19 Nov 2012 21:48] Elena Stepanova
Description:
mysql-server/5.5 revno 3953

Syscall param pwrite64(buf) points to uninitialised byte(s)
   at 0x5B21A73: ??? (syscall-template.S:82)
   by 0x8F1ACD: my_pwrite (my_pread.c:162)
   by 0xAB4BF4: inline_mysql_file_pwrite (mysql_file.h:1201)
   by 0xAB964E: mi_state_info_write (mi_open.c:904)
   by 0xA9C005: update_state_info (mi_check.c:4450)
   by 0xA888C2: ha_myisam::repair(THD*, st_mi_check_param&, bool) (ha_myisam.cc:1163)
   by 0xA87EAC: ha_myisam::optimize(THD*, st_ha_check_opt*) (ha_myisam.cc:1020)
   by 0x7772BC: handler::ha_optimize(THD*, st_ha_check_opt*) (handler.cc:3425)
   by 0x6F5713: mysql_admin_table(THD*, TABLE_LIST*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned int, int (*)(THD*, TABLE_LIST*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, TABLE_LIST*)) (sql_admin.cc:601)
   by 0x6F707A: Optimize_table_statement::execute(THD*) (sql_admin.cc:1019)
   by 0x6046C9: mysql_execute_command(THD*) (sql_parse.cc:4431)
   by 0x60714E: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5627)
   by 0x5FB1A0: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1037)
   by 0x5FA4B5: do_command(THD*) (sql_parse.cc:773)
   by 0x6E5DCA: do_handle_one_connection(THD*) (sql_connect.cc:840)
   by 0x6E57FE: handle_one_connection (sql_connect.cc:759)
 Address 0x40af3bc is on thread 13's stack

How to repeat:
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (4),(3),(1),(0);
ALTER TABLE t1 DISABLE KEYS;
OPTIMIZE TABLE t1;
[21 Nov 2012 14:32] MySQL Verification Team
Thank you for the bug report.

121121 12:27:30 [Note] bin/mysqld: ready for connections.
Version: '5.5.30-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
==14474== Thread 17:
==14474== Syscall param pwrite64(buf) points to uninitialised byte(s)
==14474==    at 0x4E3BEC3: ??? (in /lib64/libpthread-2.12.so)
==14474==    by 0x8A91C5: my_pwrite (my_pread.c:162)
==14474==    by 0x8EFFBB: inline_mysql_file_pwrite (mysql_file.h:1201)
==14474==    by 0x8F461F: mi_state_info_write (mi_open.c:911)
==14474==    by 0x8D9D35: update_state_info (mi_check.c:4450)
==14474==    by 0x8C7F6E: ha_myisam::repair(THD*, st_mi_check_param&, bool) (ha_myisam.cc:1163)
==14474==    by 0x8C762D: ha_myisam::optimize(THD*, st_ha_check_opt*) (ha_myisam.cc:1020)
==14474==    by 0x748D82: handler::ha_optimize(THD*, st_ha_check_opt*) (handler.cc:3454)
==14474==    by 0x6CDFC8: mysql_admin_table(THD*, TABLE_LIST*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned int, int (*)(THD*, TABLE_LIST*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, TABLE_LIST*)) (sql_admin.cc:601)
==14474==    by 0x6CF844: Optimize_table_statement::execute(THD*) (sql_admin.cc:1039)
==14474==    by 0x5EB2C0: mysql_execute_command(THD*) (sql_parse.cc:4431)
==14474==    by 0x5EDC50: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5627)
==14474==  Address 0x40b872c is on thread 17's stack